--- ray/src/rt/persist.c 2004/09/17 21:43:50 2.35 +++ ray/src/rt/persist.c 2008/04/27 17:22:49 2.40 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: persist.c,v 2.35 2004/09/17 21:43:50 greg Exp $"; +static const char RCSid[] = "$Id: persist.c,v 2.40 2008/04/27 17:22:49 schorsch Exp $"; #endif /* * Routines for persistent rtrace and rpict processes. @@ -12,8 +12,13 @@ static const char RCSid[] = "$Id: persist.c,v 2.35 200 #include #include #include +#include #include "platform.h" +#ifndef NON_POSIX /* XXX need abstraction for process management */ + #include +#endif + #include "rtprocess.h" /* getpid() */ #include "standard.h" #include "random.h" @@ -121,10 +126,10 @@ pfhold(void) /* holding pattern for idle rendering pr char buf[512]; register int n; /* close input and output descriptors */ - close(fileno(stdin)); - close(fileno(stdout)); + close(0); + close(1); if (errfile == NULL) - close(fileno(stderr)); + close(2); /* create named pipes for input and output */ if (mkfifo(mktemp(strcpy(inpname,TEMPLATE)), 0600) < 0) goto createrr; @@ -335,6 +340,7 @@ io_process(void) /* just act as go-between for actual } while ((nr -= n) > 0); } } + kill(pid, SIGTERM); /* no more process to feed, so... */ waitpid(pid, 0, 0); /* wait for feeder process */ _exit(status); formerr: