diff options
author | ache <ache@FreeBSD.org> | 1995-02-25 18:06:23 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 1995-02-25 18:06:23 +0000 |
commit | cc94453d734a6e0f1194966eab77615993aa5480 (patch) | |
tree | f651b0a95cae8b23eaa23c34067fa2168350d9d1 | |
parent | bf30a23c63dfd7c2f8c4cd81ae657828b8819995 (diff) | |
download | FreeBSD-src-cc94453d734a6e0f1194966eab77615993aa5480.zip FreeBSD-src-cc94453d734a6e0f1194966eab77615993aa5480.tar.gz |
configure_network() if carrier already present
Submitted by: serg@opus.opu.odessa.ua
-rw-r--r-- | sbin/slattach/slattach.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sbin/slattach/slattach.c b/sbin/slattach/slattach.c index e8b6825..a773493 100644 --- a/sbin/slattach/slattach.c +++ b/sbin/slattach/slattach.c @@ -202,11 +202,13 @@ int main(int argc, char **argv) if (redial_on_startup) sighup_handler(); else if (!(modem_control & CLOCAL)) { - ioctl(fd, TIOCMGET, &comstate); + if (ioctl(fd, TIOCMGET, &comstate) < 0) + syslog(LOG_NOTICE,"cannot get carrier state: %m"); if (!(comstate & TIOCM_CD)) { /* check for carrier */ /* force a redial if no carrier */ kill (getpid(), SIGHUP); - } + } else + configure_network(); } else configure_network(); /* configure the network if needed. */ |