/[monit]/monit/util.c
ViewVC logotype

Diff of /monit/util.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.67 by hauk, Tue Jul 15 01:02:58 2003 UTC revision 1.68 by martinp, Wed Jul 23 07:04:28 2003 UTC
# Line 1032  void redirect_stdfd() { Line 1032  void redirect_stdfd() {
1032  }  }
1033    
1034    
1035    /*
1036     * Close all filedescriptors except standard. Everything
1037     * seems to have getdtablesize, so we'll use it here, and back
1038     * out to use 1024 if getdtablesize not available.
1039     */
1040    void fd_close() {
1041    
1042      int i;
1043      int max_descriptors = 1024;
1044    
1045    #ifdef HAVE_UNISTD_H
1046      max_descriptors = getdtablesize();
1047    #endif
1048      for(i = 3; i < max_descriptors; i++)
1049        (void) close(i);
1050      errno= 0;
1051    
1052    }
1053    
1054    
1055  /* ----------------------------------------------------------------- Private */  /* ----------------------------------------------------------------- Private */
1056    
1057    

Legend:
Removed from v.1.67  
changed lines
  Added in v.1.68

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26