util: allocate log filename buffers 19/12219/4
authorMichael Meffie <mmeffie@sinenomine.net>
Mon, 14 Mar 2016 20:09:56 +0000 (16:09 -0400)
committerBenjamin Kaduk <kaduk@mit.edu>
Mon, 25 Apr 2016 04:04:15 +0000 (00:04 -0400)
commit340ec2f79208ee21c3130c4b1c13995947ce426c
treeebe9b598d5e8b0b9248bcf44c9b1cd9accd9961a
parent1a72f4a917f14c97ab067eb303252e3244cb59d1
util: allocate log filename buffers

Allocate the ourName buffer to save the log filename during OpenLog(),
instead of trying to copy the log filename to a fixed size buffer.
Deallocate this buffer when the log is closed with CloseLog().  Save the
log file name even when MR-AFS style logging is not effect to allow
ReOpenLog() to use the saved filename in a later commit.

Dynamically allocate a buffer when formatting a file name for log
rotation instead of using a fixed size buffer on the stack.  Allocate
the buffer for both traditional Transarc-style log file renaming
(appending ".old" to the log filename) and the MR-AFS style logging
(appending a timestamp to the log filename).

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