diff options
author | ache <ache@FreeBSD.org> | 1994-11-14 20:17:36 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 1994-11-14 20:17:36 +0000 |
commit | 75b7af8528ec56d829490b74b83c2a4caec68474 (patch) | |
tree | ee82fa2aa828e30cef83efb3372c750be3e41655 /sbin/slattach | |
parent | 12e7d94646144dcbd097822d43f2a10b9c3931a1 (diff) | |
download | FreeBSD-src-75b7af8528ec56d829490b74b83c2a4caec68474.zip FreeBSD-src-75b7af8528ec56d829490b74b83c2a4caec68474.tar.gz |
Check exit code of the dialer, from asa@gw.cronyx.msk.su
Set HUPCL as default modem flag, idea from asa@gw.cronyx.msk.su
but different implementation.
Diffstat (limited to 'sbin/slattach')
-rw-r--r-- | sbin/slattach/slattach.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sbin/slattach/slattach.c b/sbin/slattach/slattach.c index e18a48c..e8b6825 100644 --- a/sbin/slattach/slattach.c +++ b/sbin/slattach/slattach.c @@ -77,7 +77,7 @@ void acquire_line(); /* get tty device as controling terminal */ int fd = -1; char *dev = (char *)0; /* path name of the tty (e.g. /dev/tty01) */ int flow_control = 0; /* non-zero to enable hardware flow control. */ -int modem_control = 0; /* non-zero iff we watch carrier. */ +int modem_control = HUPCL; /* !CLOCAL+HUPCL iff we watch carrier. */ int comstate; /* TIOCMGET current state of serial driver */ int redial_on_startup = 0; /* iff non-zero execute redial_cmd on startup */ int speed = DEFAULT_BAUD; /* baud rate of tty */ @@ -133,7 +133,7 @@ int main(int argc, char **argv) flow_control |= CRTSCTS; break; case 'l': - modem_control |= CLOCAL; + modem_control = CLOCAL; /* clear HUPCL too */ break; case 'n': slflags |= IFF_LINK1; @@ -373,7 +373,8 @@ again: setup_line(CLOCAL); syslog(LOG_NOTICE,"SIGHUP on %s (sl%d); running %s", dev,unit,redial_cmd); - system(redial_cmd); + if (system(redial_cmd)) + goto again; /* Now check again for carrier (dial command is done): */ if (!(modem_control & CLOCAL)) { tty.c_cflag &= ~CLOCAL; |