--- ray/src/rt/persist.c 1996/07/19 10:16:00 2.17 +++ ray/src/rt/persist.c 1997/10/28 14:00:02 2.21 @@ -12,23 +12,9 @@ static char SCCSid[] = "$SunId$ LBL"; #ifdef F_SETLKW #include "paths.h" +#include "selcall.h" #include -#include #include - /* select call compatibility stuff */ -#ifndef FD_SETSIZE -#include -#define FD_SETSIZE NOFILE /* maximum # select file descriptors */ -#endif -#ifndef FD_SET -#ifndef NFDBITS -#define NFDBITS (8*sizeof(int)) /* number of bits per fd_mask */ -#endif -#define FD_SET(n, p) ((p)->fds_bits[(n)/NFDBITS] |= (1 << ((n) % NFDBITS))) -#define FD_CLR(n, p) ((p)->fds_bits[(n)/NFDBITS] &= ~(1 << ((n) % NFDBITS))) -#define FD_ISSET(n, p) ((p)->fds_bits[(n)/NFDBITS] & (1 << ((n) % NFDBITS))) -#define FD_ZERO(p) bzero((char *)(p), sizeof(*(p))) -#endif #ifndef TIMELIM #define TIMELIM (8*3600) /* time limit for holding pattern */ @@ -138,9 +124,9 @@ pfhold() /* holding pattern for idle rendering proces sprintf(buf, "%s %d\n%s\n%s\n%s\n", progname, getpid(), inpname, outpname, errname); n = strlen(buf); - lseek(persistfd, 0L, 0); if (write(persistfd, buf, n) < n) error(SYSTEM, "error writing persist file"); + lseek(persistfd, 0L, 0); /* wait TIMELIM for someone to signal us */ got_io = 0; signal(SIGIO, sig_io); @@ -265,7 +251,7 @@ io_process() /* just act as go-between for actual pro goto readerr; if (nr == 0) { close(fderr); - close(2); + /* close(2); don't close stderr! */ fderr = -1; } else do { /* write it all */