--- ray/src/rt/persist.c 2004/03/30 16:13:01 2.34 +++ ray/src/rt/persist.c 2008/04/21 07:31:30 2.39 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: persist.c,v 2.34 2004/03/30 16:13:01 schorsch Exp $"; +static const char RCSid[] = "$Id: persist.c,v 2.39 2008/04/21 07:31:30 schorsch Exp $"; #endif /* * Routines for persistent rtrace and rpict processes. @@ -12,6 +12,10 @@ static const char RCSid[] = "$Id: persist.c,v 2.34 200 #include #include #include +#include +#ifndef NON_POSIX /* XXX need abstraction for process management */ + #include +#endif #include "platform.h" #include "rtprocess.h" /* getpid() */ @@ -121,10 +125,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,7 +339,8 @@ io_process(void) /* just act as go-between for actual } while ((nr -= n) > 0); } } - wait(0); /* wait for feeder process */ /* XXX platform */ + kill(pid, SIGTERM); /* no more process to feed, so... */ + waitpid(pid, 0, 0); /* wait for feeder process */ _exit(status); formerr: error(USER, "format error in persist file");