Lines Matching refs:lock_file
772 static char lock_file[MAXPATHLEN];
786 ppp_strlcpy(lock_file, dev, sizeof(lock_file));
793 ppp_error("Can't create lock file %s", lock_file);
812 ppp_slprintf(lock_file, sizeof(lock_file), "%s/LK.%03d.%03d.%03d",
831 ppp_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 ppp_error("Can't create lock file %s: %m", lock_file);
841 fd = open(lock_file, O_RDONLY, 0);
845 ppp_error("Can't open existing lock file %s: %m", lock_file);
856 ppp_error("Can't read pid from lock file %s", lock_file);
869 if (unlink (lock_file) == 0) {
880 lock_file[0] = 0;
918 if (lock_file[0] == 0)
920 fd = open(lock_file, O_WRONLY, 0);
922 ppp_error("Couldn't reopen lock file %s: %m", lock_file);
923 lock_file[0] = 0;
945 if (lock_file[0]) {
947 (void) rmlock(lock_file, (void *) 0);
949 unlink(lock_file);
951 lock_file[0] = 0;