ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/win_process.c
(Generate patch)

Comparing ray/src/common/win_process.c (file contents):
Revision 3.9 by greg, Wed Feb 12 00:15:40 2014 UTC vs.
Revision 3.10 by greg, Fri Mar 4 02:48:14 2016 UTC

# Line 283 | Line 283 | open_process(SUBPROC *proc, char *av[])
283                  fputs("Illegal call to open_process()!\n", stderr);
284                  return -1;
285          }
286 +        proc->pid = 0;
287          proc->running = 0;
288          if (av == NULL) { return -1; }
289          cmdpath = getpath(av[0], getenv("PATH"), X_OK);
# Line 319 | Line 320 | int win_kill(RT_PID pid, int sig) /* we ignore sig...
320  
321  
322   int
323 < close_process(SUBPROC *proc) {
324 <        int icres, ocres;
323 > close_processes(SUBPROC pd[], int nproc) {
324 >        int i, icres, ocres;
325          DWORD pid;
326  
327 <        ocres = close(proc->w);
328 <        icres = close(proc->r);
329 <        pid = proc->pid;
330 <        if(ocres != 0 || icres != 0) {
331 <                /* something went wrong: enforce infanticide */
331 <                /* other than that, it looks like we want to ignore errors here */
332 <                if (proc->running) {
333 <                        win_kill(pid, 0);
327 >        for (i = 0; i < nproc; i++) {
328 >                if (pid[i].running) {
329 >                        ocres = close(pd[i].w);
330 >                        icres = close(pd[i].r);
331 >                        pd[i].running = 0;
332                  }
333 +                if(ocres != 0 || icres != 0) {
334 +                        /* something went wrong: enforce infanticide */
335 +                        /* other than that, it looks like we want to ignore errors here */
336 +                        win_kill(pd[i].pid, 0);
337 +                }
338 +                pd[i].pid = 0;
339          }
336        proc->running = 0;
340          return 0; /* XXX we need to figure out more here... */
341   }
342  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines