svn commit: trunk/busybox/sysklogd

vda at busybox.net vda at busybox.net
Mon Mar 2 14:26:29 UTC 2009


Author: vda
Date: 2009-03-02 14:26:28 +0000 (Mon, 02 Mar 2009)
New Revision: 25484

Log:
syslogd: create logfile with 0666, not 0600.



Modified:
   trunk/busybox/sysklogd/syslogd.c


Changeset:
Modified: trunk/busybox/sysklogd/syslogd.c
===================================================================
--- trunk/busybox/sysklogd/syslogd.c	2009-03-02 12:07:15 UTC (rev 25483)
+++ trunk/busybox/sysklogd/syslogd.c	2009-03-02 14:26:28 UTC (rev 25484)
@@ -306,17 +306,23 @@
 	}
 #endif
 	if (G.logFD >= 0) {
+		/* Reopen log file every second. This allows admin
+		 * to delete the file and not worry about restarting us.
+		 * This costs almost nothing since it happens
+		 * _at most_ once a second.
+		 */
 		if (!now)
 			now = time(NULL);
 		if (G.last_log_time != now) {
-			G.last_log_time = now; /* reopen log file every second */
+			G.last_log_time = now;
 			close(G.logFD);
 			goto reopen;
 		}
 	} else {
  reopen:
-		G.logFD = device_open(G.logFilePath, O_WRONLY | O_CREAT
-					| O_NOCTTY | O_APPEND | O_NONBLOCK);
+		G.logFD = open(G.logFilePath, O_WRONLY | O_CREAT
+					| O_NOCTTY | O_APPEND | O_NONBLOCK,
+					0666);
 		if (G.logFD < 0) {
 			/* cannot open logfile? - print to /dev/console then */
 			int fd = device_open(DEV_CONSOLE, O_WRONLY | O_NOCTTY | O_NONBLOCK);



More information about the busybox-cvs mailing list