Lines Matching refs:lockfile

79 static int onelock __PR((pid_t pid, char *uuname, char *lockfile));
82 lockit(lockfile, count, pid, uuname) in lockit() argument
83 char *lockfile; /* The z.file path (e.g. SCCS/z.foo) */ in lockit()
98 copy(lockfile, tempfile);
104 copy(lockfile, tempfile);
123 if (lockfile == NULL)
128 if (onelock(pid, uuname, lockfile) == 0)
132 if (!exists(lockfile))
136 if ((fd = open(lockfile, O_RDONLY|O_BINARY)) < 0)
153 if ((exists(lockfile)) &&
156 (void) unlink(lockfile);
185 if (exists(lockfile) &&
189 (void) unlink(lockfile);
198 lockrefresh(lockfile) in lockrefresh() argument
199 char *lockfile; /* The z.file path (e.g. SCCS/z.foo) */ in lockrefresh()
204 return (utimens(lockfile, NULL));
208 unlockit(lockfile, pid, uuname) in unlockit() argument
209 char *lockfile; in unlockit()
217 if (lockfile == NULL || lockfile[0] == '\0')
220 if (mylock(lockfile, pid, uuname))
221 return (unlink(lockfile));
231 onelock(pid, uuname, lockfile) in onelock() argument
234 char *lockfile;
264 if ((fd = open(lockfile,
271 (void) unlink(lockfile);
272 return (xmsg(lockfile, NOGETTEXT("lockit")));
282 if (!mylock(lockfile, pid, uuname))
295 return (xmsg(lockfile, NOGETTEXT("lockit")));
315 ismylock(lockfile, pid, uuname) in ismylock() argument
316 char *lockfile; in ismylock()
325 if ((fd = open(lockfile, O_RDONLY|O_BINARY)) < 0) {
360 mylock(lockfile, pid, uuname) in mylock() argument
361 char *lockfile; in mylock()
365 return (ismylock(lockfile, pid, uuname) > 0);
372 lockfatal(lockfile, pid, uuname) in lockfatal() argument
373 char *lockfile; in lockfatal()
377 if (ismylock(lockfile, pid, uuname) > 0)
380 if (ismylock(lockfile, getppid(), uuname) > 0)