cvs commit: src/usr.sbin/rwhod rwhod.c

Sascha Wildner saw at online.de
Fri May 6 19:33:00 PDT 2005


Liam J. Foy wrote:
liamfoy     2005/05/06 10:16:19 PDT

DragonFly src repository

  Modified files:
    usr.sbin/rwhod       rwhod.c 
  Log:
  - Produce more informative output to syslog. Generally improve/clean error handling
  
  Ok: dillon
  
  Revision  Changes    Path
  1.14      +52 -54    src/usr.sbin/rwhod/rwhod.c

http://www.dragonflybsd.org/cvsweb/src/usr.sbin/rwhod/rwhod.c.diff?r1=1.13&r2=1.14&f=u
Hmmm...Isn't "if (wrterrno)" always true here?

-----------------
+#define WITH_ERRNO		1	/* Write to syslog with errno (%m) */
+#define WITHOUT_ERRNO		2	/* Write to syslog without errno */
[...]

+/*
+ * If wrterrno == WITH_ERRNO, we will print
+ * errno. If not, we leave errno out.
+ */
 void
-quit(const char *msg)
+quit(const char *msg, int wrterrno)
 {
-
-	syslog(LOG_ERR, "%s", msg);
+	if (wrterrno)
+		syslog(LOG_ERR, "%s: %m", msg);
+	else
+		syslog(LOG_ERR, "%s", msg);
 	exit(1);
 }
-----------------
Sascha

--
http://yoyodyne.ath.cx




More information about the Commits mailing list