Lines Matching refs:lock_file
903 static char lock_file[MAXPATHLEN]; variable
917 strlcpy(lock_file, dev, sizeof(lock_file));
924 error("Can't create lock file %s", lock_file);
943 slprintf(lock_file, sizeof(lock_file), "%s/LK.%03d.%03d.%03d",
962 slprintf(lock_file, sizeof(lock_file), "%s/LCK..%s", LOCK_DIR, dev);
965 while ((fd = open(lock_file, O_EXCL | O_CREAT | O_RDWR, 0644)) < 0) {
967 error("Can't create lock file %s: %m", lock_file);
972 fd = open(lock_file, O_RDONLY, 0);
976 error("Can't open existing lock file %s: %m", lock_file);
987 error("Can't read pid from lock file %s", lock_file);
1000 if (unlink (lock_file) == 0) {
1011 lock_file[0] = 0;
1049 if (lock_file[0] == 0)
1051 fd = open(lock_file, O_WRONLY, 0);
1053 error("Couldn't reopen lock file %s: %m", lock_file);
1054 lock_file[0] = 0;
1076 if (lock_file[0]) { in unlock()
1078 (void) rmlock(lock_file, (void *) 0); in unlock()
1080 unlink(lock_file); in unlock()
1082 lock_file[0] = 0; in unlock()