aboutsummaryrefslogtreecommitdiff
path: root/sysklogd
diff options
context:
space:
mode:
authorJoshua Judson Rosen <jrosen@harvestai.com>2014-05-20 01:02:19 -0400
committerDenys Vlasenko <vda.linux@googlemail.com>2014-06-02 03:11:39 +0200
commitb905d6c2eaaf7ad92a50dccc7b91ee19dd9424b7 (patch)
tree54c9bfcd28946e991f1e3df49e24101122e475ee /sysklogd
parent1b90e031c3a3bd6dc5c2a34193ec6e9727b79a39 (diff)
downloadbusybox-b905d6c2eaaf7ad92a50dccc7b91ee19dd9424b7.tar.gz
syslogd: remember to un-writelock log-files even when called with "-b 0"
Signed-off-by: Joshua Judson Rosen <jrosen@harvestai.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'sysklogd')
-rw-r--r--sysklogd/syslogd.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sysklogd/syslogd.c b/sysklogd/syslogd.c
index 2c959ff1b..d77fc9475 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