]> git.ozlabs.org Git - ppp.git/blobdiff - pppd/utils.c
Header file reorganization and cleaning up the public API for pppd version 2.5.0...
[ppp.git] / pppd / utils.c
index e75bb9c8eecd21279a999c18f8c0bc4f132ef1e3..c1bdbbbfe4e52d8a06edb3c8b22462580b3644a3 100644 (file)
 #include <sys/mkdev.h>
 #endif
 
-#include "pppd.h"
+#include "pppd-private.h"
 #include "fsm.h"
 #include "lcp.h"
+#include "pathnames.h"
 
 
 #if defined(SUNOS4)
@@ -767,7 +768,7 @@ complete_read(int fd, void *buf, size_t count)
        for (done = 0; done < count; ) {
                nb = read(fd, ptr, count - done);
                if (nb < 0) {
-                       if (errno == EINTR && !got_sigterm)
+                       if (errno == EINTR && !ppp_signaled(SIGTERM))
                                continue;
                        return -1;
                }
@@ -781,18 +782,6 @@ complete_read(int fd, void *buf, size_t count)
 #endif
 
 /* Procedures for locking the serial device using a lock file. */
-#ifndef LOCK_DIR
-#ifdef __linux__
-#define LOCK_DIR       "/var/lock"
-#else
-#ifdef SVR4
-#define LOCK_DIR       "/var/spool/locks"
-#else
-#define LOCK_DIR       "/var/spool/lock"
-#endif
-#endif
-#endif /* LOCK_DIR */
-
 static char lock_file[MAXPATHLEN];
 
 /*
@@ -833,7 +822,7 @@ lock(char *dev)
        return -1;
     }
     slprintf(lock_file, sizeof(lock_file), "%s/LK.%03d.%03d.%03d",
-            LOCK_DIR, major(sbuf.st_dev),
+            PPP_PATH_LOCKDIR, major(sbuf.st_dev),
             major(sbuf.st_rdev), minor(sbuf.st_rdev));
 #else
     char *p;
@@ -851,7 +840,7 @@ lock(char *dev)
        if ((p = strrchr(dev, '/')) != NULL)
            dev = p + 1;
 
-    slprintf(lock_file, sizeof(lock_file), "%s/LCK..%s", LOCK_DIR, dev);
+    slprintf(lock_file, sizeof(lock_file), "%s/LCK..%s", PPP_PATH_LOCKDIR, dev);
 #endif
 
     while ((fd = open(lock_file, O_EXCL | O_CREAT | O_RDWR, 0644)) < 0) {