From 608985f7ea1648142872983631e209443c0e76f6 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 28 Oct 2002 22:04:47 +0000 Subject: Fix fd leak with kernel change notify. Jeremy. (This used to be commit 78df2c916ae3940f0124912f99b1e0ca3914fff5) --- source3/smbd/notify_kernel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3') diff --git a/source3/smbd/notify_kernel.c b/source3/smbd/notify_kernel.c index 8454917163..df553721ef 100644 --- a/source3/smbd/notify_kernel.c +++ b/source3/smbd/notify_kernel.c @@ -127,7 +127,6 @@ static void kernel_remove_notify(void *datap) BlockSignals(True, RT_SIGNAL_NOTIFY); for (i = 0; i < signals_received; i++) { if (fd == (int)fd_pending_array[i]) { - close(fd); fd_pending_array[i] = (SIG_ATOMIC_T)-1; if (signals_received - i - 1) { memmove((void *)&fd_pending_array[i], (void *)&fd_pending_array[i+1], @@ -138,6 +137,7 @@ static void kernel_remove_notify(void *datap) break; } } + close(fd); BlockSignals(False, RT_SIGNAL_NOTIFY); } SAFE_FREE(data); -- cgit