From 8051406588987005f621cb095067d3628638d250 Mon Sep 17 00:00:00 2001 From: John Terpstra Date: Sat, 14 Apr 2001 18:39:32 +0000 Subject: Patch from Mandrakesoft to ensure we close all files. --- source/client/smbmount.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source') diff --git a/source/client/smbmount.c b/source/client/smbmount.c index 35677815fff..7da96ba8c35 100644 --- a/source/client/smbmount.c +++ b/source/client/smbmount.c @@ -95,7 +95,9 @@ static void daemonize(void) static void close_our_files(int client_fd) { int i; - for (i = 0; i < 256; i++) { + + getrlimit(RLIMIT_NOFILE,&limits); + for (1 = 0; i< limits.rlim_max, i++) { if (i == client_fd) continue; close(i); } -- cgit