X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=pppd%2Fsys-svr4.c;h=02643182995039fb27d7a25516e9995b738eca03;hb=10a68fd183c5e16e95fce56e7b292f1436b1e714;hp=a8d80b91ba5f5e6a8339e2c76cc81802d0377171;hpb=5ba9d88b943e9d5a3ababdadf1d2e246581dfdc6;p=ppp.git diff --git a/pppd/sys-svr4.c b/pppd/sys-svr4.c index a8d80b9..0264318 100644 --- a/pppd/sys-svr4.c +++ b/pppd/sys-svr4.c @@ -25,9 +25,7 @@ * OR MODIFICATIONS. */ -#ifndef lint -static char rcsid[] = "$Id: sys-svr4.c,v 1.29 1999/03/22 05:55:39 paulus Exp $"; -#endif +#define RCSID "$Id: sys-svr4.c,v 1.33 1999/08/13 06:46:20 paulus Exp $" #include #include @@ -60,13 +58,17 @@ static char rcsid[] = "$Id: sys-svr4.c,v 1.29 1999/03/22 05:55:39 paulus Exp $"; #include #include #include +#ifdef SOL2 #include #include #include #include +#endif #include "pppd.h" +static const char rcsid[] = RCSID; + static int pppfd; static int fdmuxid = -1; static int ipfd; @@ -222,7 +224,7 @@ sys_check_options() return 1; } - +#if 0 /* * daemon - Detach us from controlling terminal session. */ @@ -246,6 +248,7 @@ daemon(nochdir, noclose) } return 0; } +#endif /* * ppp_available - check whether the system has any ppp interfaces @@ -277,11 +280,14 @@ establish_ppp(fd) /* Push the async hdlc module and the compressor module. */ tty_npushed = 0; - if (ioctl(fd, I_PUSH, "ppp_ahdl") < 0) { - error("Couldn't push PPP Async HDLC module: %m"); - return -1; + + if(!sync_serial) { + if (ioctl(fd, I_PUSH, "ppp_ahdl") < 0) { + error("Couldn't push PPP Async HDLC module: %m"); + return -1; + } + ++tty_npushed; } - ++tty_npushed; if (kdebugflag & 4) { i = PPPDBG_LOG + PPPDBG_AHDLC; strioctl(pppfd, PPPIO_DEBUG, &i, sizeof(int), 0); @@ -453,6 +459,9 @@ struct speed { #ifdef B57600 { 57600, B57600 }, #endif +#ifdef B76800 + { 76800, B76800 }, +#endif #ifdef B115200 { 115200, B115200 }, #endif @@ -509,7 +518,7 @@ set_up_tty(fd, local) struct termiox tiox; #endif - if (tcgetattr(fd, &tios) < 0) + if (!sync_serial && tcgetattr(fd, &tios) < 0) fatal("tcgetattr: %m"); #ifndef CRTSCTS @@ -574,7 +583,7 @@ set_up_tty(fd, local) fatal("Baud rate for %s is 0; need explicit baud rate", devnam); } - if (tcsetattr(fd, TCSAFLUSH, &tios) < 0) + if (!sync_serial && tcsetattr(fd, TCSAFLUSH, &tios) < 0) fatal("tcsetattr: %m"); #ifndef CRTSCTS @@ -1610,9 +1619,9 @@ logwtmp(line, name, host) if (name[0] != 0) { /* logging in */ - strlcpy(utmpx.ut_user, name, sizeof(utmpx.ut_user)); - strlcpy(utmpx.ut_id, ifname, sizeof(utmpx.ut_id)); - strlcpy(utmpx.ut_line, line, sizeof(utmpx.ut_line)); + strncpy(utmpx.ut_user, name, sizeof(utmpx.ut_user)); + strncpy(utmpx.ut_id, ifname, sizeof(utmpx.ut_id)); + strncpy(utmpx.ut_line, line, sizeof(utmpx.ut_line)); utmpx.ut_pid = getpid(); utmpx.ut_type = USER_PROCESS; } else { @@ -1656,6 +1665,7 @@ strioctl(fd, cmd, ptr, ilen, olen) return 0; } +#if 0 /* * lock - create a lock file for the named lock device */ @@ -1733,7 +1743,7 @@ unlock() lock_file[0] = 0; } } - +#endif /* * cifroute - delete a route through the addresses given. @@ -1775,6 +1785,7 @@ int have_route_to(addr) u_int32_t addr; { +#ifdef SOL2 int fd, r, flags, i; struct { struct T_optmgmt_req req; @@ -1865,6 +1876,9 @@ have_route_to(addr) } close(fd); return 0; +#else + return -1; +#endif /* SOL2 */ } /*