Home
last modified time | relevance | path

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

/freebsd/usr.bin/lockf/
H A Dlockf.c58 static int lockfd = -1; variable
209 lockfd = acquire_lock(&subj, flags | O_NONBLOCK, silent); in main()
210 while (lockfd == -1 && !timed_out && waitsec != 0) { in main()
212 lockfd = acquire_lock(&subj, flags, silent); in main()
215 lockfd = acquire_lock(&subj, flags | O_NONBLOCK, in main()
221 if (lockfd == -1) { /* We failed to acquire the lock. */ in main()
240 close(lockfd); in main()
298 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()
/freebsd/crypto/openssh/
H A Dsshkey-xmss.c72 int lockfd; /* locked in sshkey_xmss_get_state() */ member
127 state->lockfd = -1; in sshkey_xmss_init()
451 int lockfd = -1, have_state = 0, have_ostate, tries = 0; in sshkey_xmss_get_state() local
478 if ((lockfd = open(lockfile, O_CREAT|O_RDONLY, 0600)) == -1) { in sshkey_xmss_get_state()
483 while (flock(lockfd, LOCK_EX|LOCK_NB) == -1) { in sshkey_xmss_get_state()
521 state->lockfd = lockfd; in sshkey_xmss_get_state()
523 lockfd = -1; in sshkey_xmss_get_state()
526 if (lockfd != -1) in sshkey_xmss_get_state()
527 close(lockfd); in sshkey_xmss_get_state()
663 if (state->lockfd != -1) { in sshkey_xmss_update_state()
[all …]