summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2016-04-14 13:27:41 +0200
committerJosé Bollo <jose.bollo@iot.bzh>2016-04-14 13:27:41 +0200
commit37d39868e7eed7ff3c8420dec0e3e82caa7cd868 (patch)
tree60bdf39d179152df270023093e918baac9fc6c82
parentd3a68744e728b77d2c37f51e865f2f49e533b6f7 (diff)
removes use of printf
Change-Id: I635e236e102837256c77fd4379ef9b11d850a4de Signed-off-by: José Bollo <jose.bollo@iot.bzh>
-rw-r--r--src/afb-hreq.c2
-rw-r--r--src/afb-hsrv.c2
-rw-r--r--src/main.c12
3 files changed, 8 insertions, 8 deletions
diff --git a/src/afb-hreq.c b/src/afb-hreq.c
index 9984cbcb..045a0d60 100644
--- a/src/afb-hreq.c
+++ b/src/afb-hreq.c
@@ -219,7 +219,7 @@ static magic_t lazy_libmagic()
/* MAGIC_MIME tells magic to return a mime of the file,
but you can specify different things */
if (verbosity)
- printf("Loading mimetype default magic database\n");
+ fprintf(stderr, "Loading mimetype default magic database\n");
result = magic_open(MAGIC_MIME_TYPE);
if (result == NULL) {
diff --git a/src/afb-hsrv.c b/src/afb-hsrv.c
index 2c303d3c..73ad6a60 100644
--- a/src/afb-hsrv.c
+++ b/src/afb-hsrv.c
@@ -336,7 +336,7 @@ int afb_hsrv_start(struct afb_hsrv *hsrv, uint16_t port, unsigned int connection
MHD_OPTION_END); /* options-end */
if (httpd == NULL) {
- printf("Error: httpStart invalid httpd port: %d", (int)port);
+ fprintf(stderr, "Error: httpStart invalid httpd port: %d", (int)port);
return 0;
}
diff --git a/src/main.c b/src/main.c
index d58a897a..1a728dda 100644
--- a/src/main.c
+++ b/src/main.c
@@ -470,7 +470,7 @@ static void daemonize(AFB_session *session)
if (pid != 0) _exit (0);
// son process get all data in standalone mode
- printf ("\nAFB: background mode [pid:%d console:%s]\n", getpid(),session->config->console);
+ fprintf (stderr, "\nAFB: background mode [pid:%d console:%s]\n", getpid(),session->config->console);
// redirect default I/O on console
close (2); dup(consoleFD); // redirect stderr
@@ -542,7 +542,7 @@ int main(int argc, char *argv[]) {
// --------- run -----------
if (session->background) {
// --------- in background mode -----------
- if (verbosity) printf ("AFB: Entering background mode\n");
+ if (verbosity) fprintf (stderr, "AFB: Entering background mode\n");
daemonize(session);
} else {
// ---- in foreground mode --------------------
@@ -606,19 +606,19 @@ static struct afb_hsrv *start(AFB_config * config)
if (!afb_hsrv_set_cache_timeout(hsrv, config->cacheTimeout)
|| !init(hsrv, config)) {
- printf("Error: initialisation of httpd failed");
+ fprintf (stderr, "Error: initialisation of httpd failed");
afb_hsrv_put(hsrv);
return NULL;
}
if (verbosity) {
- printf("AFB:notice Waiting port=%d rootdir=%s\n", config->httpdPort, config->rootdir);
- printf("AFB:notice Browser URL= http:/*localhost:%d\n", config->httpdPort);
+ fprintf (stderr, "AFB:notice Waiting port=%d rootdir=%s\n", config->httpdPort, config->rootdir);
+ fprintf (stderr, "AFB:notice Browser URL= http:/*localhost:%d\n", config->httpdPort);
}
rc = afb_hsrv_start(hsrv, (uint16_t) config->httpdPort, 15);
if (!rc) {
- printf("Error: starting of httpd failed");
+ fprintf (stderr, "Error: starting of httpd failed");
afb_hsrv_put(hsrv);
return NULL;
}