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

Comparing ray/src/util/rtcontrib.c (file contents):
Revision 1.22 by greg, Tue Jun 14 02:50:23 2005 UTC vs.
Revision 1.24 by greg, Fri Jun 17 16:07:18 2005 UTC

# Line 315 | Line 315 | main(int argc, char *argv[])
315                  error(USER, "missing octree argument");
316          rtargv[rtargc++] = octree = argv[i];
317          rtargv[rtargc] = NULL;
318 <                                /* start rtrace & compute contributions */
318 >                                /* start rtrace */
319          init(nprocs);
320          if (recover)            /* perform recovery if requested */
321                  recover_output(stdin);
322 <        trace_contribs(stdin);
322 >        trace_contribs(stdin);  /* compute contributions */
323          quit(0);
324   }
325  
# Line 1030 | Line 1030 | recover_output(FILE *fin)
1030                                  error(USER, "cannot recover from command");
1031                                                  /* open output */
1032                          fp = fopen(oname, "rb+");
1033 <                        if (fp == NULL)
1034 <                                break;          /* must be end of modifier */
1033 >                        if (fp == NULL) {
1034 >                                if (j)
1035 >                                        break;  /* assume end of modifier */
1036 >                                sprintf(errmsg, "missing recover file '%s'",
1037 >                                                oname);
1038 >                                error(USER, errmsg);
1039 >                        }
1040                          nvals = lseek(fileno(fp), 0, SEEK_END);
1041                          if (nvals <= 0) {
1042                                  lastout = 0;    /* empty output, quit here */
# Line 1085 | Line 1090 | recover_output(FILE *fin)
1090          if (lastout < 0) {
1091                  error(WARNING, "no output files to recover");
1092                  return;
1093 +        }
1094 +        if (raysleft && lastout >= raysleft) {
1095 +                error(WARNING, "output appears to be complete");
1096 +                /* XXX should read & discard input? */
1097 +                quit(0);
1098          }
1099                                                  /* seek on all files */
1100          nvals = lastout * outvsiz;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines