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

/freebsd-11.0-release/release/picobsd/tinyware/passwd/
H A Dpw_util.c68 static int lockfd; variable
127 lockfd = open(masterpasswd, O_RDONLY, 0);
128 if (lockfd < 0 || fcntl(lockfd, F_SETFD, 1) == -1)
130 if (flock(lockfd, LOCK_EX|LOCK_NB))
138 if (fstat(lockfd, &st) < 0)
142 close(lockfd);
143 lockfd = -1;
145 return (lockfd);
/freebsd-11.0-release/usr.bin/lockf/
H A Dlockf.c49 static int lockfd = -1; variable
125 lockfd = acquire_lock(lockname, flags | O_NONBLOCK);
126 while (lockfd == -1 && !timed_out && waitsec != 0) {
128 lockfd = acquire_lock(lockname, flags);
131 lockfd = acquire_lock(lockname, flags | O_NONBLOCK);
136 if (lockfd == -1) { /* We failed to acquire the lock. */
147 close(lockfd);
188 flock(lockfd, LOCK_UN);
/freebsd-11.0-release/lib/libutil/
H A Dgr_util.c47 static int lockfd = -1; variable
104 lockfd = flopen(group_file, O_RDONLY|O_NONBLOCK|O_CLOEXEC, 0);
105 if (lockfd == -1) {
112 if (fstat(lockfd, &st) == -1)
116 close(lockfd);
117 lockfd = -1;
119 return (lockfd);
361 if (lockfd != -1)
362 close(lockfd);
H A Dpw_util.c72 static int lockfd = -1; variable
181 lockfd = flopen(masterpasswd, O_RDONLY|O_NONBLOCK|O_CLOEXEC, 0);
182 if (lockfd == -1) {
195 if (fstat(lockfd, &st) == -1)
199 close(lockfd);
200 lockfd = -1;
202 return (lockfd);
372 if (lockfd != -1)
373 close(lockfd);

Completed in 113 milliseconds