--- ray/src/rt/persist.c 2006/06/07 17:52:04 2.38 +++ ray/src/rt/persist.c 2010/12/15 17:24:29 2.42 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: persist.c,v 2.38 2006/06/07 17:52:04 schorsch Exp $"; +static const char RCSid[] = "$Id: persist.c,v 2.42 2010/12/15 17:24:29 greg Exp $"; #endif /* * Routines for persistent rtrace and rpict processes. @@ -13,9 +13,12 @@ static const char RCSid[] = "$Id: persist.c,v 2.38 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" @@ -36,9 +39,9 @@ static char *persistfname = NULL; /* persist file name static int persistfd = -1; /* persist file descriptor */ static char inpname[TEMPLEN+1], outpname[TEMPLEN+1], errname[TEMPLEN+1]; -typedef void (sighandler_t)(int); -static sighandler_t sig_io; -static sighandler_t sig_alrm; +typedef void (rsighandler_t)(int); +static rsighandler_t sig_io; +static rsighandler_t sig_alrm; extern void @@ -119,7 +122,7 @@ static void sig_alrm(int i) { quit(0); } extern void pfhold(void) /* holding pattern for idle rendering process */ { - sighandler_t *oldalrm; + rsighandler_t *oldalrm; char buf[512]; register int n; /* close input and output descriptors */ @@ -154,12 +157,6 @@ pfhold(void) /* holding pattern for idle rendering pr signal(SIGIO, SIG_DFL); pflock(1); /* grab persist file back */ /* someone wants us; reopen stdin and stdout */ - /* - if (freopen(inpname, "r", stdin) == NULL) - goto openerr; - if (freopen(outpname, "w", stdout) == NULL) - goto openerr; - */ close(0); if (open(inpname, O_RDONLY) != 0) error(INTERNAL, "unexpected stdin file number"); @@ -182,8 +179,6 @@ pfhold(void) /* holding pattern for idle rendering pr return; createrr: error(SYSTEM, "cannot create named pipes in pfhold"); -openerr: - error(SYSTEM, "cannot open named pipes in pfhold"); }