From: Joshua Judson Rosen Date: Tue, 20 May 2014 05:02:19 +0000 (-0400) Subject: syslogd: remember to un-writelock log-files even when called with "-b 0" X-Git-Tag: 1_23_0~108 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=b905d6c2eaaf7ad92a50dccc7b91ee19dd9424b7;p=oweals%2Fbusybox.git syslogd: remember to un-writelock log-files even when called with "-b 0" Signed-off-by: Joshua Judson Rosen Signed-off-by: Denys Vlasenko --- 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