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.28 by schorsch, Thu Jun 26 00:58:10 2003 UTC vs.
Revision 2.29 by schorsch, Mon Jun 30 14:59:12 2003 UTC

# Line 9 | Line 9 | static const char      RCSid[] = "$Id$";
9  
10   #include "copyright.h"
11  
12 + #include <string.h>
13 + #include <signal.h>
14 + #include <sys/stat.h>
15 + #ifdef _WIN32
16 + #include <process.h> /* getpid() */
17 + #endif
18 +
19   #include "standard.h"
20   #include "random.h"
21  
22   #ifdef F_SETLKW
23   #include "paths.h"
24   #include "selcall.h"
18 #include <signal.h>
19 #include <sys/stat.h>
25  
26   #ifndef TIMELIM
27   #define TIMELIM         (8*3600)        /* time limit for holding pattern */
# Line 209 | Line 214 | io_process()           /* just act as go-between for actual pro
214   #endif
215          pfdetach();                     /* close & release persist file */
216          buf[nr] = '\0';                 /* parse what we got */
217 <        if ((cp = index(buf, ' ')) == NULL)
217 >        if ((cp = strchr(buf, ' ')) == NULL)
218                  goto formerr;
219          *cp++ = '\0';
220          if ((pid = atoi(cp)) <= 0)
221                  goto formerr;
222 <        if ((cp = index(cp, '\n')) == NULL)
222 >        if ((cp = strchr(cp, '\n')) == NULL)
223                  goto formerr;
224          pfin = ++cp;
225 <        if ((cp = index(cp, '\n')) == NULL)
225 >        if ((cp = strchr(cp, '\n')) == NULL)
226                  goto formerr;
227          *cp++ = '\0';
228          pfout = cp;
229 <        if ((cp = index(cp, '\n')) == NULL)
229 >        if ((cp = strchr(cp, '\n')) == NULL)
230                  goto formerr;
231          *cp++ = '\0';
232          pferr = cp;
233 <        if ((cp = index(cp, '\n')) == NULL)
233 >        if ((cp = strchr(cp, '\n')) == NULL)
234                  goto formerr;
235          *cp++ = '\0';
236          if (cp-buf != nr)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines