X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=pppd%2Futils.c;h=c1bdbbbfe4e52d8a06edb3c8b22462580b3644a3;hb=ba7f7e053daae846a54a1d08d3d133a5f1266ace;hp=e75bb9c8eecd21279a999c18f8c0bc4f132ef1e3;hpb=eff574c871822c7e2788aa8a928f2480fa7a6cb3;p=ppp.git diff --git a/pppd/utils.c b/pppd/utils.c index e75bb9c..c1bdbbb 100644 --- a/pppd/utils.c +++ b/pppd/utils.c @@ -58,9 +58,10 @@ #include #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) {