summaryrefslogtreecommitdiffstats
path: root/usr.sbin/pppd/options.c
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/options.c
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/options.c')
-rw-r--r--usr.sbin/pppd/options.c11
1 files changed, 6 insertions, 5 deletions
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