diff --git a/pmc.c b/pmc.c index 5c44d94..d9f4613 100644 --- a/pmc.c +++ b/pmc.c @@ -347,8 +347,8 @@ int main(int argc, char *argv[]) pollfd[1].fd = fdarray.fd[FD_GENERAL]; pollfd[1].events = POLLIN|POLLPRI; - print_no_syslog(); - print_verbose(); + print_set_syslog(1); + print_set_verbose(1); while (1) { cnt = poll(pollfd, N_FD, -1); diff --git a/print.c b/print.c index f42d254..069cec6 100644 --- a/print.c +++ b/print.c @@ -24,13 +24,13 @@ #include "print.h" -static int verbose; +static int verbose = 0; static int print_level = LOG_INFO; static int use_syslog = 1; -void print_no_syslog(void) +void print_set_syslog(int value) { - use_syslog = 0; + use_syslog = value ? 1 : 0; } void print_set_level(int level) @@ -38,9 +38,9 @@ void print_set_level(int level) print_level = level; } -void print_verbose(void) +void print_set_verbose(int value) { - verbose = 1; + verbose = value ? 1 : 0; } void print(int level, char const *format, ...) diff --git a/print.h b/print.h index 1b42b2b..ad18105 100644 --- a/print.h +++ b/print.h @@ -24,9 +24,9 @@ void print(int level, char const *format, ...); -void print_no_syslog(void); +void print_set_syslog(int value); void print_set_level(int level); -void print_verbose(void); +void print_set_verbose(int value); #define pr_emerg(x...) print(LOG_EMERG, x) #define pr_alert(x...) print(LOG_ALERT, x) diff --git a/ptp4l.c b/ptp4l.c index 764d1d4..14d93f2 100644 --- a/ptp4l.c +++ b/ptp4l.c @@ -63,8 +63,8 @@ static void usage(char *progname) " (ignored for SOFTWARE/LEGACY HW time stamping)\n" " -s slave only mode (overrides configuration file)\n" " -l [num] set the logging level to 'num'\n" - " -q quiet mode, do not use syslog(3)\n" - " -v verbose mode, print messages to stdout\n" + " -q do not print messages to the syslog\n" + " -v print messages to stdout\n" " -h prints this message and exits\n" "\n", progname); @@ -137,10 +137,10 @@ int main(int argc, char *argv[]) print_set_level(atoi(optarg)); break; case 'q': - print_no_syslog(); + print_set_syslog(1); break; case 'v': - print_verbose(); + print_set_verbose(1); break; case 'h': usage(progname);