Home
last modified time | relevance | path

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

/freebsd-12.1/release/picobsd/tinyware/passwd/
H A Dpw_util.c70 static int lockfd; variable
129 lockfd = open(masterpasswd, O_RDONLY, 0); in pw_lock()
130 if (lockfd < 0 || fcntl(lockfd, F_SETFD, 1) == -1) in pw_lock()
132 if (flock(lockfd, LOCK_EX|LOCK_NB)) in pw_lock()
140 if (fstat(lockfd, &st) < 0) in pw_lock()
144 close(lockfd); in pw_lock()
145 lockfd = -1; in pw_lock()
147 return (lockfd); in pw_lock()
/freebsd-12.1/usr.bin/lockf/
H A Dlockf.c51 static int lockfd = -1; variable
127 lockfd = acquire_lock(lockname, flags | O_NONBLOCK); in main()
128 while (lockfd == -1 && !timed_out && waitsec != 0) { in main()
130 lockfd = acquire_lock(lockname, flags); in main()
133 lockfd = acquire_lock(lockname, flags | O_NONBLOCK); in main()
138 if (lockfd == -1) { /* We failed to acquire the lock. */ in main()
149 close(lockfd); in main()
192 flock(lockfd, LOCK_UN); in cleanup()
/freebsd-12.1/lib/libutil/
H A Dgr_util.c49 static int lockfd = -1; variable
106 lockfd = flopen(group_file, O_RDONLY|O_NONBLOCK|O_CLOEXEC, 0); in gr_lock()
107 if (lockfd == -1) { in gr_lock()
114 if (fstat(lockfd, &st) == -1) in gr_lock()
118 close(lockfd); in gr_lock()
119 lockfd = -1; in gr_lock()
121 return (lockfd); in gr_lock()
374 if (lockfd != -1) in gr_fini()
375 close(lockfd); in gr_fini()
H A Dpw_util.c70 static int lockfd = -1; variable
179 lockfd = flopen(masterpasswd, O_RDONLY|O_NONBLOCK|O_CLOEXEC, 0); in pw_lock()
180 if (lockfd == -1) { in pw_lock()
193 if (fstat(lockfd, &st) == -1) in pw_lock()
197 close(lockfd); in pw_lock()
198 lockfd = -1; in pw_lock()
200 return (lockfd); in pw_lock()
370 if (lockfd != -1) in pw_fini()
371 close(lockfd); in pw_fini()
/freebsd-12.1/crypto/openssh/
H A Dsshkey-xmss.c71 int lockfd; /* locked in sshkey_xmss_get_state() */ member
125 state->lockfd = -1; in sshkey_xmss_init()
449 int lockfd = -1, have_state = 0, have_ostate, tries = 0; in sshkey_xmss_get_state() local
481 while (flock(lockfd, LOCK_EX|LOCK_NB) < 0) { in sshkey_xmss_get_state()
519 state->lockfd = lockfd; in sshkey_xmss_get_state()
521 lockfd = -1; in sshkey_xmss_get_state()
524 if (lockfd != -1) in sshkey_xmss_get_state()
525 close(lockfd); in sshkey_xmss_get_state()
662 if (state->lockfd != -1) { in sshkey_xmss_update_state()
663 close(state->lockfd); in sshkey_xmss_update_state()
[all …]