summaryrefslogtreecommitdiffstats
path: root/lib/log.c
diff options
context:
space:
mode:
authorChris Hall <chris.hall@highwayman.com>2011-03-29 19:47:32 +0100
committerChris Hall <chris.hall@highwayman.com>2011-03-29 19:47:32 +0100
commit9c99076cf33bfa874db34151e28822f0e392ab3a (patch)
treee1630b98e0bb01ad8b26c6a50a7824eb41f0c448 /lib/log.c
parent7e666be965b3ac61b05ccdeca2b61902bc26e172 (diff)
downloadquagga-9c99076cf33bfa874db34151e28822f0e392ab3a.tar.bz2
quagga-9c99076cf33bfa874db34151e28822f0e392ab3a.tar.xz
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.
Diffstat (limited to 'lib/log.c')
-rw-r--r--lib/log.c7
1 files changed, 4 insertions, 3 deletions
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() ;
}
/*------------------------------------------------------------------------------