From 9c99076cf33bfa874db34151e28822f0e392ab3a Mon Sep 17 00:00:00 2001 From: Chris Hall Date: Tue, 29 Mar 2011 19:47:32 +0100 Subject: Fix compile on older gcc, and other minor fixes. Slightly older gcc would not tolerate an offsetof() where the type part contained a '->' -- replaced foo->bar by foo[0].bar, which is more readily tolerated. Fixed assert() in "--more--". Improved some shut-down code. --- lib/log.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lib/log.c') diff --git a/lib/log.c b/lib/log.c index 28a04dc9..0c76fe95 100644 --- a/lib/log.c +++ b/lib/log.c @@ -971,6 +971,8 @@ closezlog (struct zlog *zl) { assert((zl == zlog_list) && (zl->next == NULL)) ; /* pro tem */ + LOG_LOCK() ; + closelog(); if (zl->file_fd >= 0) close (zl->file_fd) ; @@ -985,10 +987,9 @@ closezlog (struct zlog *zl) uzlog_set_effective_level(zl) ; - if (zl->filename != NULL) - free (zl->filename); - XFREE (MTYPE_ZLOG, zl); + + LOG_UNLOCK() ; } /*------------------------------------------------------------------------------ -- cgit v1.2.3