Lines Matching defs:lock_file
783 static char lock_file[MAXPATHLEN];
797 strlcpy(lock_file, sizeof(lock_file), dev);
804 error("Can't create lock file %s", lock_file);
823 slprintf(lock_file, sizeof(lock_file), "%s/LK.%03d.%03d.%03d",
831 slprintf(lock_file, sizeof(lock_file), "%s/LCK..%s", LOCK_DIR, dev);
834 while ((fd = open(lock_file, O_EXCL | O_CREAT | O_RDWR, 0644)) < 0) {
836 error("Can't create lock file %s: %m", lock_file);
841 fd = open(lock_file, O_RDONLY, 0);
845 error("Can't open existing lock file %s: %m", lock_file);
856 error("Can't read pid from lock file %s", lock_file);
869 if (unlink (lock_file) == 0) {
880 lock_file[0] = 0;
917 if (lock_file[0] == 0)
919 fd = open(lock_file, O_WRONLY, 0);
921 error("Couldn't reopen lock file %s: %m", lock_file);
922 lock_file[0] = 0;
944 if (lock_file[0]) {
946 (void) rmlock(lock_file, (void *) 0);
948 unlink(lock_file);
950 lock_file[0] = 0;