From: José Bollo Date: Thu, 14 Apr 2016 11:27:41 +0000 (+0200) Subject: removes use of printf X-Git-Tag: blowfish_2.0.1~189 X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=commitdiff_plain;h=37d39868e7eed7ff3c8420dec0e3e82caa7cd868;p=src%2Fapp-framework-binder.git removes use of printf Change-Id: I635e236e102837256c77fd4379ef9b11d850a4de Signed-off-by: José Bollo --- 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; }