Lines Matching refs:fd_lock
33 static int fd_lock = -1; variable
565 if (fd_lock >= 0) in acquire_lock()
572 fd_lock = open(lockfile, O_WRONLY|O_CREAT, S_IWUSR); in acquire_lock()
573 if (fd_lock < 0) { in acquire_lock()
577 if (fcntl(fd_lock, F_SETFD, FD_CLOEXEC) < 0) { in acquire_lock()
578 close(fd_lock); in acquire_lock()
583 rc = fcntl(fd_lock, F_SETLKW, &fl); in acquire_lock()
600 if (fd_lock < 0) in release_lock()
609 rc = fcntl(fd_lock, F_SETLKW, &fl); in release_lock()
617 close(fd_lock); in release_lock()
618 fd_lock = -1; in release_lock()