svn commit: r211709 - projects/sv/usr.sbin/netdumpsrv
Attilio Rao
attilio at FreeBSD.org
Mon Aug 23 17:08:18 UTC 2010
Author: attilio
Date: Mon Aug 23 17:08:18 2010
New Revision: 211709
URL: http://svn.freebsd.org/changeset/base/211709
Log:
Use stderr for reporting errors and stdout for the normal output.
Modified:
projects/sv/usr.sbin/netdumpsrv/netdump_server.c
Modified: projects/sv/usr.sbin/netdumpsrv/netdump_server.c
==============================================================================
--- projects/sv/usr.sbin/netdumpsrv/netdump_server.c Mon Aug 23 17:03:06 2010 (r211708)
+++ projects/sv/usr.sbin/netdumpsrv/netdump_server.c Mon Aug 23 17:08:18 2010 (r211709)
@@ -123,8 +123,7 @@ static void handle_packet(struct netdu
static void handle_timeout(struct netdump_client *client);
static void handle_vmcore(struct netdump_client *client,
struct netdump_msg *msg);
-static void phook_printf(int priority __unused,
- const char *message, ...);
+static void phook_printf(int priority, const char *message, ...);
static void phook_syslog(int priority, const char *message, ...);
static int receive_message(int isock, struct sockaddr_in *from,
char *fromstr, size_t fromstrlen,
@@ -144,12 +143,16 @@ usage(const char *cmd)
}
static void
-phook_printf(int priority __unused, const char *message, ...)
+phook_printf(int priority, const char *message, ...)
{
va_list ap;
va_start(ap, message);
- vprintf(message, ap);
+ if ((priority & LOG_INFO) != 0) {
+ assert((priority & (LOG_WARNING | LOG_ERR) == 0);
+ vprintf(message, ap);
+ } else
+ vfprintf(stderr, message, ap);
}
static void
More information about the svn-src-projects
mailing list