diff options
author | Denys Vlasenko | 2011-10-28 17:48:15 +0200 |
---|---|---|
committer | Denys Vlasenko | 2011-10-28 17:48:15 +0200 |
commit | 1e98f3741c5a844c1d3d7966f20cd09dded05d0d (patch) | |
tree | 6044a3e180389e63c55173f5018bf2ddaa195cd6 /sysklogd | |
parent | ed058016bf8fc98271de2e58bfb650de9e9d304d (diff) | |
download | busybox-1e98f3741c5a844c1d3d7966f20cd09dded05d0d.zip busybox-1e98f3741c5a844c1d3d7966f20cd09dded05d0d.tar.gz |
Apply post-1.19.2 patches, bump version to 1.19.31_19_3
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'sysklogd')
-rw-r--r-- | sysklogd/syslogd.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/sysklogd/syslogd.c b/sysklogd/syslogd.c index 2f0ca6a..fc380d9 100644 --- a/sysklogd/syslogd.c +++ b/sysklogd/syslogd.c @@ -278,7 +278,7 @@ static void parse_syslogdcfg(const char *file) parser_t *parser; parser = config_open2(file ? file : "/etc/syslog.conf", - file ? xfopen_for_read : fopen_or_warn_stdin); + file ? xfopen_for_read : fopen_for_read); if (!parser) /* didn't find default /etc/syslog.conf */ /* proceed as if we built busybox without config support */ @@ -594,6 +594,14 @@ static void log_locally(time_t now, char *msg, logFile_t *log_file) } /* newFile == "f.0" now */ rename(log_file->path, newFile); + /* Incredibly, if F and F.0 are hardlinks, POSIX + * _demands_ that rename returns 0 but does not + * remove F!!! + * (hardlinked F/F.0 pair was observed after + * power failure during rename()). + * Ensure old file is gone: + */ + unlink(log_file->path); #ifdef SYSLOGD_WRLOCK fl.l_type = F_UNLCK; fcntl(log_file->fd, F_SETLKW, &fl); @@ -678,7 +686,7 @@ static void timestamp_and_log(int pri, char *msg, int len) if (LOG_PRI(pri) < G.logLevel) { #if ENABLE_FEATURE_IPC_SYSLOG if ((option_mask32 & OPT_circularlog) && G.shbuf) { - log_to_shmem(msg); + log_to_shmem(G.printbuf); return; } #endif |