From 5fdbde0aebb2708236e74ffc39d50b80d20a7b49 Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Mon, 6 Sep 2004 11:23:59 +0000 Subject: (ppp_read_conf) use /dev/modem if no modem was detected (do not crash when we edit a connection whose modem is unplugged) --- perl-install/network/modem.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'perl-install/network') diff --git a/perl-install/network/modem.pm b/perl-install/network/modem.pm index 91e047066..0ce904902 100644 --- a/perl-install/network/modem.pm +++ b/perl-install/network/modem.pm @@ -17,7 +17,10 @@ sub first_modem { sub ppp_read_conf { my ($netcnx, $netc) = @_; my $modem = $netcnx->{$netcnx->{type}} ||= {}; - $modem->{device} ||= first_modem($netc)->{device}; + if (my $detected_modem = first_modem($netc)) { + $modem->{device} ||= $detected_modem->{device}; + } + $modem->{device} ||= '/dev/modem'; my %l = getVarsFromSh("$::prefix/usr/share/config/kppprc"); $l{Authentication} = 4 if !exists $l{Authentication}; $modem->{$_} ||= $l{$_} foreach qw(Authentication Gateway IPAddr SubnetMask); -- cgit v1.2.1