Based on Marius Tomaschewski work. Signed-off-by: Eric leblond <eric@xxxxxx> --- :100644 100644 07364b6... 563fc3b... M output/ulogd_output_OPRINT.c output/ulogd_output_OPRINT.c | 5 ++++- 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: -- 1.5.2.5 - To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html