[git commit] syslogd: remember to un-writelock log-files even when called with "-b 0"

Denys Vlasenko vda.linux at googlemail.com
Mon Jun 2 01:11:39 UTC 2014


commit: http://git.busybox.net/busybox/commit/?id=b905d6c2eaaf7ad92a50dccc7b91ee19dd9424b7
branch: http://git.busybox.net/busybox/commit/?id=refs/heads/master

Signed-off-by: Joshua Judson Rosen <jrosen at harvestai.com>
Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 sysklogd/syslogd.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/sysklogd/syslogd.c b/sysklogd/syslogd.c
index 2c959ff..d77fc94 100644
--- a/sysklogd/syslogd.c
+++ b/sysklogd/syslogd.c
@@ -670,6 +670,10 @@ static void log_locally(time_t now, char *msg, logFile_t *log_file)
 		 */
 		ftruncate(log_file->fd, 0);
 		log_file->size = 0;
+#ifdef SYSLOGD_WRLOCK
+		fl.l_type = F_UNLCK;
+		fcntl(log_file->fd, F_SETLKW, &fl);
+#endif
 	}
 	log_file->size +=
 #endif


More information about the busybox-cvs mailing list