extern int debugsw;
-extern pid_t xpid; /* mhshowsbr.c or mhbuildsbr.c */
-
/* cache policies */
int rcachesw = CACHE_ASK;
int wcachesw = CACHE_ASK;
int len, buflen;
char *bp, query[BUFSIZ];
- if (xpid) {
- if (xpid < 0)
- xpid = -xpid;
- pidcheck (pidwait (xpid, NOTOK));
- xpid = 0;
- }
-
/* Get buffer ready to go */
bp = query;
buflen = sizeof(query);
int mask, usemap;
char mapfile[BUFSIZ], mapname[BUFSIZ];
FILE *fp;
+ int failed_to_lock = 0;
static int partno, pid;
static time_t clock = 0;
make_intermediates (mapfile);
mask = umask (writing == 2 ? 0077 : 0);
- if (!(fp = lkfopendata (mapfile, "a")) && errno == ENOENT) {
+ if (!(fp = lkfopendata (mapfile, "a", &failed_to_lock)) && errno == ENOENT) {
int fd;
if ((fd = creat (mapfile, 0666)) != NOTOK) {
close (fd);
- fp = lkfopendata (mapfile, "a");
+ fp = lkfopendata (mapfile, "a", &failed_to_lock);
+ if (failed_to_lock) {
+ adios (mapfile, "failed to lock");
+ }
}
}
umask (mask);
char buf[BUFSIZ], name[NAMESZ];
FILE *fp;
m_getfld_state_t gstate = 0;
+ int failed_to_lock = 0;
- if (!(fp = lkfopendata (mapfile, "r")))
+ if (!(fp = lkfopendata (mapfile, "r", &failed_to_lock)))
return NOTOK;
for (;;) {