DragonFly BSD
DragonFly commits List (threaded) for 2005-05
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

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


From: Sascha Wildner <saw@xxxxxxxxx>
Date: Sat, 07 May 2005 04:33:00 +0200

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



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]