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

Comparing ray/src/px/pcompos.c (file contents):
Revision 2.11 by greg, Wed Aug 12 12:39:52 1992 UTC vs.
Revision 2.12 by greg, Thu Aug 13 10:49:04 1992 UTC

# Line 365 | Line 365 | err:
365   }
366  
367  
368 + #ifdef  NIX
369 +
370 + quit(code)
371 + int  code;
372 + {
373 +        exit(code);
374 + }
375 +
376 + #else
377 +
378 + #include  <signal.h>
379 +
380   quit(code)              /* exit gracefully */
381   int  code;
382   {
383          int  status;
384  
385 <        if (code == 0)                  /* reap any children */
386 <                while (wait(&status) != -1)
387 <                        if (code == 0)
388 <                                code = status>>8 & 0xff;
385 >        if (code) {             /* abnormal exit -- kill children */
386 >                signal(SIGPIPE, SIG_IGN);
387 >                kill(0, SIGPIPE);
388 >        }
389 >                                /* reap any children */
390 >        while (wait(&status) != -1)
391 >                if (code == 0)
392 >                        code = status>>8 & 0xff;
393          exit(code);
394   }
395 +
396 + #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines