[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    [PATCH 2/3] syslogd: remember to un-writelock log-files even when called with "-b 0"
From:       Joshua Judson Rosen <jrosen () harvestai ! com>
Date:       2014-05-20 5:02:19
Message-ID: 1400562140-16307-2-git-send-email-jrosen () harvestai ! com
[Download RAW message or body]

Signed-off-by: Joshua Judson Rosen <jrosen@harvestai.com>
---
 sysklogd/syslogd.c |    4 ++++
 1 file changed, 4 insertions(+)

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
-- 
1.7.10.4

_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic