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

Diff of /monit/daemonize.c

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

revision 1.7 by chopp, Mon Aug 26 16:28:39 2002 UTC revision 1.8 by hauk, Tue Nov 5 12:24:35 2002 UTC
# Line 69  Line 69 
69   */   */
70  void  daemonize() {  void  daemonize() {
71    
   int i;  
72    pid_t pid;    pid_t pid;
73        
     
74    /*    /*
75     * Clear file creation mask     * Clear file creation mask
76     */     */
# Line 128  void  daemonize() { Line 126  void  daemonize() {
126     * Attach standard descriptors to /dev/null. Other descriptors     * Attach standard descriptors to /dev/null. Other descriptors
127     * should be closed in env.c     * should be closed in env.c
128     */     */
129    for(i= 0; i < 3; i++) {    redirect_stdfd();
       
     if(close(i) == -1 || open("/dev/null", O_RDWR) != i) {  
         
       log("Cannot reopen standard file descriptor (%d) -- %s\n", i, STRERROR);  
   
     }  
       
   }  
130    
131  }  }
132    

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

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