From 0fff69f974ac8add92da2ee3e0e08084c09e6e9a Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 28 Oct 2002 22:04:14 +0000 Subject: Fix fd leak with kernel change notify. Jeremy. (This used to be commit a2043390734b38cab8fe2f013960272c0e202b99) --- source3/smbd/notify_kernel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/smbd') 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