Patch from Mandrakesoft to ensure we close all files.
authorJohn Terpstra <jht@samba.org>
Sat, 14 Apr 2001 18:39:32 +0000 (18:39 +0000)
committerJohn Terpstra <jht@samba.org>
Sat, 14 Apr 2001 18:39:32 +0000 (18:39 +0000)
source/client/smbmount.c

index 35677815fff4a42016695a0dc3612ff9627140b1..7da96ba8c3508dd6300bbd6d2f09af4b43eb40a5 100644 (file)
@@ -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);
        }