]> granicus.if.org Git - sudo/commitdiff
support for HAVE_SYSCONF
authorTodd C. Miller <Todd.Miller@courtesan.com>
Tue, 24 May 1994 16:03:26 +0000 (16:03 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Tue, 24 May 1994 16:03:26 +0000 (16:03 +0000)
sudo.c

diff --git a/sudo.c b/sudo.c
index dee455a6d36c1d8c02ad7cacf7ed60cdcb6602de..962119b9712014a1470d647c4fb09656560a409c 100644 (file)
--- a/sudo.c
+++ b/sudo.c
@@ -136,8 +136,13 @@ main(argc, argv)
      * close all file descriptors to make sure we have a nice
      * clean slate from which to work.  
      */
+#ifdef HAVE_SYSCONF
+    for (rtn = sysconf(_SC_OPEN_MAX) - 1; rtn > 3; rtn--)
+       (void) close(rtn);
+#else
     for (rtn = getdtablesize() - 1; rtn > 3; rtn--)
        (void) close(rtn);
+#endif /* HAVE_SYSCONF */
 
     load_globals();            /* load the user host cmnd and uid variables */