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 */ |
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) |