From b905d6c2eaaf7ad92a50dccc7b91ee19dd9424b7 Mon Sep 17 00:00:00 2001 From: Joshua Judson Rosen Date: Tue, 20 May 2014 01:02:19 -0400 Subject: syslogd: remember to un-writelock log-files even when called with "-b 0" Signed-off-by: Joshua Judson Rosen Signed-off-by: Denys Vlasenko --- sysklogd/syslogd.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'sysklogd') 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 -- cgit v1.2.3