/[meta-cvs]/meta-cvs/F-83F0E6A90D5BBCDFB58440970E850925.c
ViewVC logotype

Diff of /meta-cvs/F-83F0E6A90D5BBCDFB58440970E850925.c

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

revision 1.11 by kaz, Thu Feb 13 06:16:42 2003 UTC revision 1.12 by kaz, Fri Feb 21 06:48:43 2003 UTC
# Line 8  Line 8 
8  #include <sys/types.h>  #include <sys/types.h>
9  #include <sys/stat.h>  #include <sys/stat.h>
10  #include <sys/wait.h>  #include <sys/wait.h>
11    #ifdef __CYGWIN__
12    #include <process.h>
13    #endif
14    
15  /*  /*
16   * Null pointer test   * Null pointer test
# Line 171  bail: Line 174  bail:
174    return 0;    return 0;
175  }  }
176    
177    /*
178     * We need this because CLISP sets it to SIG_IGN, which is
179     * inherited by the exec'd image, and causes the wait()
180     * functions to have behavior that programs don't expect.
181     */
182    
183    void mcvs_default_sigchld()
184    {
185        signal(SIGCHLD, SIG_DFL);
186    }
187    
188  /*  /*
189   * <unistd.h> -- fork, wait*, exec*   * <unistd.h> -- fork, wait*, exec*
190   */   */
191    
192  #ifdef __CYGWIN__  #ifdef __CYGWIN__
   
193  /*  /*
194   * waitpid is broken garbage on Cygwin, so we use its spawnvp function   * On Cygwin, we have a straightforward alternative to fork exec
195   * instead!   * and wait, so let's use it.
196   */   */
197    
 #include <process.h>  
198  int mcvs_spawn(const char *name, const char *const *argv)  int mcvs_spawn(const char *name, const char *const *argv)
199  {  {
200    return spawnvp(_P_WAIT, name, argv);    return spawnvp(_P_WAIT, name, argv);
# Line 199  int mcvs_spawn(const char *name, char *c Line 211  int mcvs_spawn(const char *name, char *c
211      goto out;      goto out;
212    
213    if (child == 0) {    if (child == 0) {
214      /*      mcvs_default_sigchld();
      * We need this because CLISP sets it to SIG_IGN, which is  
      * inherited by the exec'd image, and causes the wait()  
      * functions to have behavior that programs don't expect.  
      */  
     signal(SIGCHLD, SIG_DFL);  
215      execvp(name, argv);      execvp(name, argv);
216      _exit(EXIT_FAILURE);      _exit(EXIT_FAILURE);
217    }    }

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.12

  ViewVC Help
Powered by ViewVC 1.1.5