Home
last modified time | relevance | path

Searched refs:lockfd (Results 1 – 4 of 4) sorted by relevance

/freebsd/usr.bin/lockf/
H A Dlockf.c64 static int lockfd = -1; variable
226 lockfd = acquire_lock(&subj, flags | O_NONBLOCK, silent); in main()
227 while (lockfd == -1 && !timed_out && waitsec != 0) { in main()
229 lockfd = acquire_lock(&subj, flags, silent); in main()
232 lockfd = acquire_lock(&subj, flags | O_NONBLOCK, in main()
241 if (lockfd == -1) { /* We failed to acquire the lock. */ in main()
281 close(lockfd); in main()
297 (void)dprintf(lockfd, "%d\n", (int)child); in main()
356 flock(lockfd, LOCK_UN); in cleanup()
/freebsd/tools/test/stress2/lib/
H A Dresources.c49 static int lockfd; variable
166 if ((lockfd = open(lockpath, in getdf()
176 if (lockfd != -1) in getdf()
182 if (lockfd == -1) in getdf()
245 close(lockfd); in reservedf()
/freebsd/lib/libutil/
H A Dgr_util.c46 static int lockfd = -1; variable
103 lockfd = flopen(group_file, O_RDONLY|O_NONBLOCK|O_CLOEXEC, 0); in gr_lock()
104 if (lockfd == -1) { in gr_lock()
111 if (fstat(lockfd, &st) == -1) in gr_lock()
115 close(lockfd); in gr_lock()
116 lockfd = -1; in gr_lock()
118 return (lockfd); in gr_lock()
371 if (lockfd != -1) in gr_fini()
372 close(lockfd); in gr_fini()
H A Dpw_util.c67 static int lockfd = -1; variable
176 lockfd = flopen(masterpasswd, O_RDONLY|O_NONBLOCK|O_CLOEXEC, 0); in pw_lock()
177 if (lockfd == -1) { in pw_lock()
190 if (fstat(lockfd, &st) == -1) in pw_lock()
194 close(lockfd); in pw_lock()
195 lockfd = -1; in pw_lock()
197 return (lockfd); in pw_lock()
370 if (lockfd != -1) in pw_fini()
371 close(lockfd); in pw_fini()