summaryrefslogtreecommitdiffstats
path: root/perl-install/network/network.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2002-11-06 17:38:26 +0000
committerPascal Rigaux <pixel@mandriva.com>2002-11-06 17:38:26 +0000
commitb8a25c88bba7e597dd0c148e15693672d2a30f85 (patch)
tree9c4922a45aa7ae98e414169afa898e4b19593a13 /perl-install/network/network.pm
parent922d528b7664b8b885f596055bd25232f3df32a7 (diff)
downloaddrakx-b8a25c88bba7e597dd0c148e15693672d2a30f85.tar
drakx-b8a25c88bba7e597dd0c148e15693672d2a30f85.tar.gz
drakx-b8a25c88bba7e597dd0c148e15693672d2a30f85.tar.bz2
drakx-b8a25c88bba7e597dd0c148e15693672d2a30f85.tar.xz
drakx-b8a25c88bba7e597dd0c148e15693672d2a30f85.zip
replace complex "unless"s with "if"s
Diffstat (limited to 'perl-install/network/network.pm')
-rw-r--r--perl-install/network/network.pm4
1 files changed, 2 insertions, 2 deletions
diff --git a/perl-install/network/network.pm b/perl-install/network/network.pm
index 4c92ead01..ed5c7f0f5 100644
--- a/perl-install/network/network.pm
+++ b/perl-install/network/network.pm
@@ -84,7 +84,7 @@ sub write_resolv_conf {
#- get the list of used dns.
my %used_dns; @used_dns{$netc->{dnsServer}, $netc->{dnsServer2}, $netc->{dnsServer3}} = (1, 2, 3);
- unless ($netc->{DOMAINNAME} || $netc->{DOMAINNAME2} || keys %used_dns > 0) {
+ if (!$netc->{DOMAINNAME} && !$netc->{DOMAINNAME2} && !%used_dns) {
unlink($file);
log::l("neither domain name nor dns server are configured");
return 0;
@@ -107,7 +107,7 @@ sub write_resolv_conf {
unlink $file; #- workaround situation when /etc/resolv.conf is an absolute link to /etc/ppp/resolv.conf or whatever
open F, ">$file" or die "cannot write $file: $!";
print F "# search $_\n" foreach grep { $_ ne "$netc->{DOMAINNAME} $netc->{DOMAINNAME2}" } sort { $search{$a} <=> $search{$b} } keys %search;
- print F "search $netc->{DOMAINNAME} $netc->{DOMAINNAME2}\n" if ($netc->{DOMAINNAME} || $netc->{DOMAINNAME2});
+ print F "search $netc->{DOMAINNAME} $netc->{DOMAINNAME2}\n" if $netc->{DOMAINNAME} || $netc->{DOMAINNAME2};
#- print F "$options\n\n";
print F "# nameserver $_\n" foreach grep { ! exists $used_dns{$_} } sort { $dns{$a} <=> $dns{$b} } keys %dns;
print F "nameserver $_\n" foreach sort { $used_dns{$a} <=> $used_dns{$b} } grep { $_ } keys %used_dns;