Lines Matching refs:lockfd
333 * LOCK_FREE: close lockfd
334 * LOCK_UNLOCK: unlock lockm keep lockfd open
335 * LOCK_EXCL: F_WRLCK on lockfd
336 * LOCK_SHRD: F_RDLCK on lockfd
345 static int lockfd = -1;
352 if (lockfd == -1)
354 close(lockfd);
355 lockfd = -1;
359 if (lockfd == -1)
361 return unlock(lockfd, 0, SEEK_SET, 0);
365 if (lockfd == -1) {
374 if ((lockfd = open(lockpath, O_RDWR | O_CREAT, 0644)) < 0) {
392 ret = write_lock(lockfd, 0, SEEK_SET, 0);
394 ret = read_lock(lockfd, 0, SEEK_SET, 0);