summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Vlasenko2008-05-24 21:03:53 +0000
committerDenis Vlasenko2008-05-24 21:03:53 +0000
commit69dc3253972cbf6169abcaaef5fc7bc787a40075 (patch)
tree6eb123b8d15a7d31592d06d02707f7c862fcda65
parentbd23fbbd0a0491e00bac89fc30f31972525d95bb (diff)
downloadbusybox-69dc3253972cbf6169abcaaef5fc7bc787a40075.zip
busybox-69dc3253972cbf6169abcaaef5fc7bc787a40075.tar.gz
syslogd: do not error out on missing files to rotate. closes bug 3404.
-rw-r--r--sysklogd/syslogd.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sysklogd/syslogd.c b/sysklogd/syslogd.c
index f8fc517..1b8d718 100644
--- a/sysklogd/syslogd.c
+++ b/sysklogd/syslogd.c
@@ -347,10 +347,11 @@ static void log_locally(time_t now, char *msg)
sprintf(newFile, "%s.%d", G.logFilePath, i);
if (i == 0) break;
sprintf(oldFile, "%s.%d", G.logFilePath, --i);
- xrename(oldFile, newFile);
+ /* ignore errors - file might be missing */
+ rename(oldFile, newFile);
}
/* newFile == "f.0" now */
- xrename(G.logFilePath, newFile);
+ rename(G.logFilePath, newFile);
fl.l_type = F_UNLCK;
fcntl(G.logFD, F_SETLKW, &fl);
close(G.logFD);