From ee74c3327aeadabe5b55102e9d05ca3dc9f21d41 Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Wed, 27 Feb 2019 18:13:41 +0000 Subject: [PATCH] rtsol: Use vwarnx(3) to log messages to standard error. This ensures that the program name is included in the output, which makes it easy to identify the source of error messages printed during boot. MFC after: 1 week --- usr.sbin/rtsold/rtsold.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/usr.sbin/rtsold/rtsold.c b/usr.sbin/rtsold/rtsold.c index ceacca6a258a..2c1199a29bf3 100644 --- a/usr.sbin/rtsold/rtsold.c +++ b/usr.sbin/rtsold/rtsold.c @@ -787,10 +787,8 @@ warnmsg(int priority, const char *func, const char *msg, ...) va_start(ap, msg); if (fflag) { - if (priority <= log_upto) { - (void)vfprintf(stderr, msg, ap); - (void)fprintf(stderr, "\n"); - } + if (priority <= log_upto) + vwarnx(msg, ap); } else { snprintf(buf, sizeof(buf), "<%s> %s", func, msg); msg = buf;