From 6b7b3971fba5a5fa37e303d0fe3b78c64d413a60 Mon Sep 17 00:00:00 2001 From: Peter Haag Date: Thu, 12 Dec 2024 08:14:47 +0100 Subject: [PATCH] Fix writing pid file in nfpcapd. #582 --- src/nfpcapd/nfpcapd.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/nfpcapd/nfpcapd.c b/src/nfpcapd/nfpcapd.c index 4d2284e6..99e5a248 100755 --- a/src/nfpcapd/nfpcapd.c +++ b/src/nfpcapd/nfpcapd.c @@ -651,8 +651,10 @@ int main(int argc, char *argv[]) { } if (pidfile) { - if (check_pid(pidfile) != 0 || write_pid(pidfile) == 0) pcap_close(packetParam.pcap_dev); - exit(EXIT_FAILURE); + if (check_pid(pidfile) != 0 || write_pid(pidfile) == 0) { + pcap_close(packetParam.pcap_dev); + exit(EXIT_FAILURE); + } } if (metricsocket && !OpenMetric(metricsocket, metricInterval)) {