diff options
author | brian <brian@FreeBSD.org> | 1997-09-23 22:07:51 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 1997-09-23 22:07:51 +0000 |
commit | c73c4cd778b151b09d86d9184640e758e58fa955 (patch) | |
tree | 1073359ba01526783e4e1eb0c54ffef4223fb1d5 /usr.sbin/ppp/modem.c | |
parent | 6e6bff0c5eaaf459435dc5f19e929aeb190d6a9f (diff) | |
download | FreeBSD-src-c73c4cd778b151b09d86d9184640e758e58fa955.zip FreeBSD-src-c73c4cd778b151b09d86d9184640e758e58fa955.tar.gz |
Don't luse uu_lock in -direct mode. It conflicts w/
hylafax & the like.
Get the CD bit right at last - now that I've got
my second modem back - loss of carrier makes ppp exit.
Diffstat (limited to 'usr.sbin/ppp/modem.c')
-rw-r--r-- | usr.sbin/ppp/modem.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/usr.sbin/ppp/modem.c b/usr.sbin/ppp/modem.c index 0a41320..eb97a02 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: modem.c,v 1.56 1997/09/22 00:55:46 brian Exp $ + * $Id: modem.c,v 1.57 1997/09/22 23:59:14 brian Exp $ * * TODO: */ @@ -443,7 +443,7 @@ LockModem() if (*VarDevice != '/') return 0; - if ((res = uu_lock(VarBaseDevice)) != UU_LOCK_OK) { + if (!(mode & MODE_DIRECT) && (res = uu_lock(VarBaseDevice)) != UU_LOCK_OK) { if (res == UU_LOCK_INUSE) LogPrintf(LogPHASE, "Modem %s is in use\n", VarDevice); else @@ -474,7 +474,7 @@ UnlockModem() if (unlink(fn) == -1) LogPrintf(LogALERT, "Warning: Can't remove %s: %s\n", fn, strerror(errno)); - if (uu_unlock(VarBaseDevice) == -1) + if (!(mode & MODE_DIRECT) && uu_unlock(VarBaseDevice) == -1) LogPrintf(LogALERT, "Warning: Can't uu_unlock %s\n", fn); } @@ -499,11 +499,12 @@ OpenModem(int mode) close(0); return -1; } + modem = 0; } else { LogPrintf(LogDEBUG, "OpenModem(direct): Modem is not a tty\n"); SetVariable(0, 0, 0, VAR_DEVICE); + return modem = 0; } - return modem = 0; } else { if (strncmp(VarDevice, "/dev/", 5) == 0) { if (LockModem() == -1) |