]> andersk Git - moira.git/commitdiff
Simplify syslog_com_err_proc, and make it not drop the second argument
authorzacheiss <zacheiss>
Thu, 24 Apr 2003 18:40:03 +0000 (18:40 +0000)
committerzacheiss <zacheiss>
Thu, 24 Apr 2003 18:40:03 +0000 (18:40 +0000)
on the floor.

update/update_server.c

index f50fb525b1433dab9d3d0cc96970a15dd6bba544..7c23a69bf6764688e0200cb90e017af1a661194d 100644 (file)
@@ -238,12 +238,10 @@ void child_handler(int signal)
 static void syslog_com_err_proc(const char *progname, long code,
                                const char *fmt, va_list args)
 {
-  char *buf;
-  int bufsiz = 1024;
+  char buf[BUFSIZ + 1];
 
-  buf = malloc(bufsiz + 1);
-  buf[bufsiz] = '\0';
+  buf[BUFSIZ] = '\0';
 
-  vsnprintf(buf, bufsiz, fmt, args);
-  syslog(LOG_NOTICE, "%s", buf);
+  vsnprintf(buf, BUFSIZ, fmt, args);
+  syslog(LOG_NOTICE, "%s: %s %s", progname, error_message(code), buf);
 }
This page took 0.033874 seconds and 5 git commands to generate.