summaryrefslogtreecommitdiffstats
path: root/output
diff options
context:
space:
mode:
Diffstat (limited to 'output')
-rw-r--r--output/ulogd_output_OPRINT.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/output/ulogd_output_OPRINT.c b/output/ulogd_output_OPRINT.c
index 07364b6..563fc3b 100644
--- a/output/ulogd_output_OPRINT.c
+++ b/output/ulogd_output_OPRINT.c
@@ -118,15 +118,18 @@ static struct config_keyset oprint_kset = {
static void sighup_handler_print(struct ulogd_pluginstance *upi, int signal)
{
struct oprint_priv *oi = (struct oprint_priv *) &upi->private;
+ FILE *old = oi->of;
switch (signal) {
case SIGHUP:
ulogd_log(ULOGD_NOTICE, "OPRINT: reopening logfile\n");
- fclose(oi->of);
oi->of = fopen(upi->config_kset->ces[0].u.string, "a");
if (!oi->of) {
ulogd_log(ULOGD_ERROR, "can't open PKTLOG: %s\n",
strerror(errno));
+ oi->of = old;
+ } else {
+ fclose(old);
}
break;
default: