From 1e3cac574dd0f03d251066043f6bbcef64751958 Mon Sep 17 00:00:00 2001 From: Zbigniew Chyla Date: Sun, 22 Mar 2015 21:55:51 +0200 Subject: Use LOG_* symbol when setting/comparing log level Currently, debug level 0 is actually LOG_SHOUT. This change doesn't affect generated binary code. --- gpsdecode.c | 2 +- gpspacket.c | 2 +- libgpsd_core.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gpsdecode.c b/gpsdecode.c index c64f2d02..b5eda7c4 100644 --- a/gpsdecode.c +++ b/gpsdecode.c @@ -639,7 +639,7 @@ static void encode(FILE *fpin, FILE *fpout) memset(&policy, '\0', sizeof(policy)); memset(&session, '\0', sizeof(session)); session.context = &context; - context.errout.debug = 0; + context.errout.debug = LOG_SHOUT; context.errout.label = "gpsdecode"; (void)strlcpy(session.gpsdata.dev.path, "stdin", diff --git a/gpspacket.c b/gpspacket.c index d8b36685..05d8f961 100644 --- a/gpspacket.c +++ b/gpspacket.c @@ -21,7 +21,7 @@ static void basic_report(const char *buf) void errout_reset(struct gpsd_errout_t *errout) { - errout->debug = 0; + errout->debug = LOG_SHOUT; errout->report = basic_report; } diff --git a/libgpsd_core.c b/libgpsd_core.c index 65ff50d4..4a601134 100644 --- a/libgpsd_core.c +++ b/libgpsd_core.c @@ -53,7 +53,7 @@ static void basic_report(const char *buf) void errout_reset(struct gpsd_errout_t *errout) { - errout->debug = 0; + errout->debug = LOG_SHOUT; errout->report = basic_report; } @@ -176,7 +176,7 @@ void gpsd_vlog(const struct gpsd_errout_t *errout, visibilize(outbuf, outlen, buf, strlen(buf)); if (getpid() == getsid(getpid())) - syslog((errlevel == 0) ? LOG_ERR : LOG_NOTICE, "%s", outbuf); + syslog((errlevel == LOG_SHOUT) ? LOG_ERR : LOG_NOTICE, "%s", outbuf); else if (errout->report != NULL) errout->report(outbuf); else -- cgit v1.2.1