Home | History | Annotate | Download | only in pppd

Lines Matching refs:lock_file

906 static char lock_file[MAXPATHLEN];
920 strlcpy(lock_file, dev, sizeof(lock_file));
927 error("Can't create lock file %s", lock_file);
946 slprintf(lock_file, sizeof(lock_file), "%s/LK.%03d.%03d.%03d",
965 slprintf(lock_file, sizeof(lock_file), "%s/LCK..%s", LOCK_DIR, dev);
968 while ((fd = open(lock_file, O_EXCL | O_CREAT | O_RDWR, 0644)) < 0) {
970 error("Can't create lock file %s: %m", lock_file);
975 fd = open(lock_file, O_RDONLY, 0);
979 error("Can't open existing lock file %s: %m", lock_file);
990 error("Can't read pid from lock file %s", lock_file);
1003 if (unlink (lock_file) == 0) {
1014 lock_file[0] = 0;
1052 if (lock_file[0] == 0)
1054 fd = open(lock_file, O_WRONLY, 0);
1056 error("Couldn't reopen lock file %s: %m", lock_file);
1057 lock_file[0] = 0;
1079 if (lock_file[0]) {
1081 (void) rmlock(lock_file, (void *) 0);
1083 unlink(lock_file);
1085 lock_file[0] = 0;