diff options
author | Joshua Judson Rosen <jrosen@harvestai.com> | 2014-05-20 01:02:19 -0400 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2014-06-02 03:11:39 +0200 |
commit | b905d6c2eaaf7ad92a50dccc7b91ee19dd9424b7 (patch) | |
tree | 54c9bfcd28946e991f1e3df49e24101122e475ee | |
parent | 1b90e031c3a3bd6dc5c2a34193ec6e9727b79a39 (diff) | |
download | busybox-w32-b905d6c2eaaf7ad92a50dccc7b91ee19dd9424b7.tar.gz busybox-w32-b905d6c2eaaf7ad92a50dccc7b91ee19dd9424b7.tar.bz2 busybox-w32-b905d6c2eaaf7ad92a50dccc7b91ee19dd9424b7.zip |
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>
-rw-r--r-- | sysklogd/syslogd.c | 4 |
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) | |||
670 | */ | 670 | */ |
671 | ftruncate(log_file->fd, 0); | 671 | ftruncate(log_file->fd, 0); |
672 | log_file->size = 0; | 672 | log_file->size = 0; |
673 | #ifdef SYSLOGD_WRLOCK | ||
674 | fl.l_type = F_UNLCK; | ||
675 | fcntl(log_file->fd, F_SETLKW, &fl); | ||
676 | #endif | ||
673 | } | 677 | } |
674 | log_file->size += | 678 | log_file->size += |
675 | #endif | 679 | #endif |