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

Comparing ray/src/rt/persist.c (file contents):
Revision 2.22 by gregl, Fri Nov 7 12:12:53 1997 UTC vs.
Revision 2.24 by gregl, Mon Nov 24 15:13:33 1997 UTC

# Line 1 | Line 1
1 < /* Copyright (c) 1996 Regents of the University of California */
1 > /* Copyright (c) 1997 Silicon Graphics, Inc. */
2  
3   #ifndef lint
4 < static char SCCSid[] = "$SunId$ LBL";
4 > static char SCCSid[] = "$SunId$ SGI";
5   #endif
6  
7   /*
# Line 170 | Line 170 | io_process()           /* just act as go-between for actual pro
170          char    buf[BUFSIZ], *pfin, *pfout, *pferr;
171          int     pid, nfds;
172          int     fdout, fderr = -1;
173 +        int     status = 0;
174          fd_set  readfds, excepfds;
175                                          /* load persist file */
176          n = 40;
# Line 268 | Line 269 | io_process()           /* just act as go-between for actual pro
269                                  close(fderr);
270                                  /* close(2);    don't close stderr! */
271                                  fderr = -1;
272 <                        } else
273 <                                do {            /* write it all */
272 >                        } else {
273 >                                cp[nr] = '\0';  /* deduce status if we can */
274 >                                n = strlen(progname);
275 >                                if (!strncmp(cp, progname, n) &&
276 >                                                cp[n++] == ':' &&
277 >                                                cp[n++] == ' ') {
278 >                                        register struct erract  *ep;
279 >                                        for (ep = erract; ep < erract+NERRS;
280 >                                                        ep++)
281 >                                                if (ep->pre[0] &&
282 >                                                        !strncmp(cp+n, ep->pre,
283 >                                                            strlen(ep->pre))) {
284 >                                                        status = ep->ec;
285 >                                                        break;
286 >                                                }
287 >                                }
288 >                                do {            /* write message */
289                                          if ((n = write(2, cp, nr)) <= 0)
290                                                  goto writerr;
291                                          cp += n;
292                                  } while ((nr -= n) > 0);
293 +                        }
294                  }
295                                                  /* renderer stdout */
296                  if (fdout >= 0 && (FD_ISSET(fdout, &readfds) ||
# Line 293 | Line 310 | io_process()           /* just act as go-between for actual pro
310                                  } while ((nr -= n) > 0);
311                  }
312          }
313 <        _exit(0);               /* we ought to return renderer error status! */
313 >        wait(0);                /* wait for feeder process */
314 >        _exit(status);
315   formerr:
316          error(USER, "format error in persist file");
317   readerr:

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines