util: always reopen the log file 25/11725/16
authorMichael Meffie <mmeffie@sinenomine.net>
Wed, 4 Feb 2015 17:19:32 +0000 (12:19 -0500)
committerBenjamin Kaduk <kaduk@mit.edu>
Mon, 25 Apr 2016 04:08:36 +0000 (00:08 -0400)
Reopen the log file even if the filename exists. This fixes the
situation where an external program moves or deletes the log
file, then creates a new file with the same log file name.

Change-Id: I3b98d6fc0d05c7ab231f84e9a271f925506ab51f
Reviewed-on: https://gerrit.openafs.org/11725
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

src/util/serverLog.c

index 8b6ea85..b42525b 100644 (file)
@@ -465,9 +465,6 @@ ReOpenLog(const char *fileName)
 {
     int flags = O_WRONLY | O_APPEND | O_CREAT;
 
-    if (access(fileName, F_OK) == 0)
-       return 0;               /* exists, no need to reopen. */
-
 #if !defined(AFS_NT40_ENV)
     if (serverLogSyslog) {
        return 0;