diff options
author | amurai <amurai@FreeBSD.org> | 1995-02-27 10:57:54 +0000 |
---|---|---|
committer | amurai <amurai@FreeBSD.org> | 1995-02-27 10:57:54 +0000 |
commit | f599fa5e62e57f67d51a1328623c6685df76eee0 (patch) | |
tree | f860ae50f7cb940e267b2689240b5031148b2153 /usr.sbin/ppp/modem.c | |
parent | 9c085a7dcf54c4a67570f27311b48f040a7d2361 (diff) | |
download | FreeBSD-src-f599fa5e62e57f67d51a1328623c6685df76eee0.zip FreeBSD-src-f599fa5e62e57f67d51a1328623c6685df76eee0.tar.gz |
Fixing minor bug and allow help(Not for all command) and quit
but not close line connection by "quit all" command if not
authorized.
Reviewed by: amurai@spec.co.jp
Submitted by: tony-o@iij.ad.jp amurai@spec.co.jp
Diffstat (limited to 'usr.sbin/ppp/modem.c')
-rw-r--r-- | usr.sbin/ppp/modem.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/usr.sbin/ppp/modem.c b/usr.sbin/ppp/modem.c index f9638a2..56a73ba 100644 --- a/usr.sbin/ppp/modem.c +++ b/usr.sbin/ppp/modem.c @@ -17,7 +17,7 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * $Id:$ + * $Id: modem.c,v 1.2 1995/02/26 12:17:45 amurai Exp $ * * TODO: */ @@ -26,6 +26,7 @@ #include <termios.h> #include <sys/ioctl.h> #include <sys/tty.h> +#include <errno.h> #include "hdlc.h" #include "lcp.h" #include "modem.h" @@ -43,7 +44,7 @@ static int mbits; /* Current DCD status */ static int connect_time; /* connection time */ static int connect_count; static struct pppTimer ModemTimer; -static char *uucplock; +static char uucplock[10]; extern int uu_lock(), uu_unlock(); extern void PacketMode(); @@ -142,7 +143,7 @@ static struct speeds{ #ifdef B38400 { 38400, B38400, }, #endif -#ifndef POSIX_SOURCE +#ifndef _POSIX_SOURCE #ifdef B7200 { 7200, B7200, }, #endif @@ -372,7 +373,7 @@ int mode; modem = open(ctermid(NULL), O_RDWR|O_NONBLOCK); } else if (modem == 0) { if (strncmp(VarDevice, "/dev", 4) == 0) { - uucplock = rindex(VarDevice, '/')+1; + strcpy(uucplock, rindex(VarDevice, '/')+1); if (uu_lock(uucplock) < 0) { fprintf(stderr, "modem is in use.\n"); return(-1); @@ -676,8 +677,10 @@ int fd; logprintf(" mbfree\n"); #endif } - } else if (nw < 0) - perror("modem write"); + } else if (nw < 0) { + if (errno != EAGAIN) + perror("modem write"); + } } } |