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

Diff of /monit/env.c

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

revision 1.9 by chopp, Mon Aug 26 16:28:39 2002 UTC revision 1.10 by rory, Wed Oct 2 03:56:27 2002 UTC
# Line 127  void init_env() { Line 127  void init_env() {
127  static void set_sandbox(void) {  static void set_sandbox(void) {
128    
129    int    i;    int    i;
130      int    max_descriptors = 1024;
131    struct stat st;    struct stat st;
132    extern char **environ;    extern char **environ;
133    char   *path = "PATH=/bin:/usr/bin:/sbin:/usr/sbin";    char   *path = "PATH=/bin:/usr/bin:/sbin:/usr/sbin";
# Line 147  static void set_sandbox(void) { Line 148  static void set_sandbox(void) {
148    }    }
149    
150    /*    /*
151     * Require that the other file descriptios are closed. Should we use     * Require that the other file descriptios are closed. Everything
152     * sysconf() or getdtablesize() or getrlimit() or...     * seems to have getdtablesize, so we'll use it here, and back
153       * out to use 1024 if getdtablesize not available.
154     */     */
155    for(i = 3; i < 1024; i++)  #ifdef HAVE_UNISTD_H
156      max_descriptors = getdtablesize();
157    #endif
158      for(i = 3; i < max_descriptors; i++)
159        (void) close(i);        (void) close(i);
160    errno= 0;    errno= 0;
161    

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

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