summaryrefslogtreecommitdiffstats
path: root/usr.sbin/pppd
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>2000-12-09 09:35:55 +0000
committerobrien <obrien@FreeBSD.org>2000-12-09 09:35:55 +0000
commitc2ee1dcc02035d781d6c70f06df7106979a9f870 (patch)
tree757810dc1fdd19be4c8125ccb9e8beb1aff3d929 /usr.sbin/pppd
parentc174181f432119d1dae3f5e58ecc14c8d7b6f545 (diff)
downloadFreeBSD-src-c2ee1dcc02035d781d6c70f06df7106979a9f870.zip
FreeBSD-src-c2ee1dcc02035d781d6c70f06df7106979a9f870.tar.gz
Add `_PATH_DEVZERO'.
Use _PATH_* where where possible.
Diffstat (limited to 'usr.sbin/pppd')
-rw-r--r--usr.sbin/pppd/auth.c5
-rw-r--r--usr.sbin/pppd/options.c11
2 files changed, 9 insertions, 7 deletions
diff --git a/usr.sbin/pppd/auth.c b/usr.sbin/pppd/auth.c
index 4cc40cb..2a580e9 100644
--- a/usr.sbin/pppd/auth.c
+++ b/usr.sbin/pppd/auth.c
@@ -41,6 +41,7 @@ static char rcsid[] = "$FreeBSD$";
#include <stdlib.h>
#include <unistd.h>
#include <syslog.h>
+#include <paths.h>
#include <pwd.h>
#include <string.h>
#include <sys/types.h>
@@ -965,7 +966,7 @@ plogin(user, passwd, msg, msglen)
/* Log in wtmp and utmp using login() */
tty = devnam;
- if (strncmp(tty, "/dev/", 5) == 0)
+ if (strncmp(tty, _PATH_DEV, sizeof _PATH_DEV - 1) == 0)
tty += 5;
if (logout(tty)) /* Already entered (by login?) */
@@ -1031,7 +1032,7 @@ plogout()
char *tty;
tty = devnam;
- if (strncmp(tty, "/dev/", 5) == 0)
+ if (strncmp(tty, _PATH_DEV, sizeof _PATH_DEV - 1) == 0)
tty += 5;
logwtmp(tty, "", ""); /* Wipe out wtmp logout entry */
logout(tty); /* Wipe out utmp */
diff --git a/usr.sbin/pppd/options.c b/usr.sbin/pppd/options.c
index f18131c..0676e3c 100644
--- a/usr.sbin/pppd/options.c
+++ b/usr.sbin/pppd/options.c
@@ -31,6 +31,7 @@ static char rcsid[] = "$FreeBSD$";
#include <syslog.h>
#include <string.h>
#include <netdb.h>
+#include <paths.h>
#include <pwd.h>
#include <sys/types.h>
#include <sys/stat.h>
@@ -80,7 +81,7 @@ int dflag = 0; /* Tell libpcap we want debugging */
int debug = 0; /* Debug flag */
int kdebugflag = 0; /* Tell kernel to print debug messages */
int default_device = 1; /* Using /dev/tty or equivalent */
-char devnam[MAXPATHLEN] = "/dev/tty"; /* Device name */
+char devnam[MAXPATHLEN] = _PATH_TTY; /* Device name */
int crtscts = 0; /* Use hardware flow control */
int modem = 1; /* Use modem control lines */
int inspeed = 0; /* Input/Output speed requested */
@@ -694,7 +695,7 @@ options_for_tty()
int ret;
dev = devnam;
- if (strncmp(dev, "/dev/", 5) == 0)
+ if (strncmp(dev, _PATH_DEV, sizeof _PATH_DEV - 1) == 0)
dev += 5;
if (strcmp(dev, "tty") == 0)
return 1; /* don't look for /etc/ppp/options.tty */
@@ -1671,9 +1672,9 @@ setdevname(cp, quiet)
if (*cp == 0)
return 0;
- if (strncmp("/dev/", cp, 5) != 0) {
- strcpy(dev, "/dev/");
- strncat(dev, cp, MAXPATHLEN - 5);
+ if (strncmp(_PATH_DEV, cp, sizeof _PATH_DEV - 1) != 0) {
+ strcpy(dev, _PATH_DEV);
+ strncat(dev, cp, MAXPATHLEN - sizeof _PATH_DEV - 1);
dev[MAXPATHLEN-1] = 0;
cp = dev;
}
OpenPOWER on IntegriCloud