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 |
|
/* |
9 |
|
*/ |
10 |
|
|
11 |
|
#include "standard.h" |
12 |
+ |
#include "random.h" |
13 |
|
|
14 |
|
#ifdef F_SETLKW |
15 |
|
#include "paths.h" |
179 |
|
if (!n--) |
180 |
|
error(USER, "unattended persist file?"); |
181 |
|
pflock(0); |
182 |
< |
sleep(15); /* wait until ready */ |
182 |
> |
sleep(3+(3*getpid()+random())%13); /* wait until ready */ |
183 |
|
pflock(1); |
184 |
|
} |
185 |
|
if (nr < 0) |
270 |
|
close(fderr); |
271 |
|
/* close(2); don't close stderr! */ |
272 |
|
fderr = -1; |
273 |
< |
} else |
273 |
> |
} else { |
274 |
|
cp[nr] = '\0'; /* deduce status if we can */ |
275 |
|
n = strlen(progname); |
276 |
|
if (!strncmp(cp, progname, n) && |
291 |
|
goto writerr; |
292 |
|
cp += n; |
293 |
|
} while ((nr -= n) > 0); |
294 |
+ |
} |
295 |
|
} |
296 |
|
/* renderer stdout */ |
297 |
|
if (fdout >= 0 && (FD_ISSET(fdout, &readfds) || |