From cc94453d734a6e0f1194966eab77615993aa5480 Mon Sep 17 00:00:00 2001 From: ache Date: Sat, 25 Feb 1995 18:06:23 +0000 Subject: configure_network() if carrier already present Submitted by: serg@opus.opu.odessa.ua --- sbin/slattach/slattach.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'sbin') 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. */ -- cgit v1.1