diff options
Diffstat (limited to 'sbin/slattach/slattach.c')
-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. */ |