Lines Matching defs:lock_file
827 static char lock_file[MAXPATHLEN];
841 (void) strlcpy(lock_file, sizeof(lock_file), dev);
848 error("Can't create lock file %s", lock_file);
867 (void) slprintf(lock_file, sizeof(lock_file), "%s/LK.%03d.%03d.%03d",
875 (void) slprintf(lock_file, sizeof(lock_file), "%s/LCK..%s", LOCK_DIR, dev);
878 while ((fd = open(lock_file, O_EXCL | O_CREAT | O_RDWR, 0644)) < 0) {
880 error("Can't create lock file %s: %m", lock_file);
885 fd = open(lock_file, O_RDONLY, 0);
889 error("Can't open existing lock file %s: %m", lock_file);
900 error("Can't read pid from lock file %s", lock_file);
913 if (unlink (lock_file) == 0) {
924 lock_file[0] = 0;
962 if (lock_file[0] == 0)
964 fd = open(lock_file, O_WRONLY, 0);
966 error("Couldn't reopen lock file %s: %m", lock_file);
967 lock_file[0] = 0;
989 if (lock_file[0]) {
991 (void) rmlock(lock_file, (void *) 0);
993 (void) unlink(lock_file);
995 lock_file[0] = 0;