util: fix file descriptor leak in mrafs-style logging 22/11722/17
authorMichael Meffie <mmeffie@sinenomine.net>
Thu, 5 Feb 2015 20:42:16 +0000 (15:42 -0500)
committerBenjamin Kaduk <kaduk@mit.edu>
Mon, 25 Apr 2016 04:05:35 +0000 (00:05 -0400)
commit4b698db3198d30aa1cf1028d3cb7856211792f18
treea3429ffa16a59262b1c1c0f048cf35ba30c93436
parentdb74758924b4d889e1c713a46be898d47f4ae6a9
util: fix file descriptor leak in mrafs-style logging

When MR-AFS style logging is in effect, the SIGHUP signal handler will rename
then create a new, empty server log file to support log rotation.

Unfortunately, the old log file descriptor is not closed, so each SIGHUP
signal will leak one file descriptor.

Be sure to close the current log file descriptor before opening the log again.
The OpenLog() routine will move the current log file to a new file, with a
timestamp string appended to the log file, then open the server log file with
truncate flag to start a new log file.

Change-Id: Ic3f29607fa50ed868b9245865e375dedde438471
Reviewed-on: https://gerrit.openafs.org/11722
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
src/util/serverLog.c