summaryrefslogtreecommitdiff
path: root/sbin/isakmpd
diff options
context:
space:
mode:
authorNiklas Hallqvist <niklas@cvs.openbsd.org>1999-07-07 22:11:15 +0000
committerNiklas Hallqvist <niklas@cvs.openbsd.org>1999-07-07 22:11:15 +0000
commit3faf1a46a810e61aa2023fc59d6f0a34a38e4189 (patch)
treeead8ac00544cc2aba17f69f8b1f8153e9bf5dacd /sbin/isakmpd
parentbe10e4f9c0bdaed149427cb6c3303b91c7bf01ba (diff)
Merge with EOM 1.24
author: ho Release lock(s) on logfile when write fails.
Diffstat (limited to 'sbin/isakmpd')
-rw-r--r--sbin/isakmpd/log.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/sbin/isakmpd/log.c b/sbin/isakmpd/log.c
index 05b8da23fdd..2541afb9551 100644
--- a/sbin/isakmpd/log.c
+++ b/sbin/isakmpd/log.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: log.c,v 1.6 1999/04/19 19:53:41 niklas Exp $ */
-/* $EOM: log.c,v 1.23 1999/04/18 15:17:24 niklas Exp $ */
+/* $OpenBSD: log.c,v 1.7 1999/07/07 22:11:14 niklas Exp $ */
+/* $EOM: log.c,v 1.24 1999/06/26 23:26:56 ho Exp $ */
/*
* Copyright (c) 1998, 1999 Niklas Hallqvist. All rights reserved.
@@ -121,6 +121,16 @@ _log_print (int error, int syslog_level, const char *fmt, va_list ap,
syslog (LOG_ALERT, fallback_msg, errno);
fprintf (log_output, fallback_msg, errno);
+ /*
+ * Close log_output to prevent isakmpd from locking the file.
+ * We may need to explicitly close stdout to do this properly.
+ * XXX - Figure out how to match two FILE *'s and rewrite.
+ */
+ if (log_output->_file != -1)
+ if (stdout->_file == log_output->_file)
+ fclose (stdout);
+ fclose (log_output);
+
/* Fallback to syslog. */
log_to (0);