summaryrefslogtreecommitdiffstats
path: root/urpm/cfg.pm
diff options
context:
space:
mode:
Diffstat (limited to 'urpm/cfg.pm')
-rw-r--r--urpm/cfg.pm8
1 files changed, 1 insertions, 7 deletions
diff --git a/urpm/cfg.pm b/urpm/cfg.pm
index 75487c98..7b96cc54 100644
--- a/urpm/cfg.pm
+++ b/urpm/cfg.pm
@@ -64,13 +64,7 @@ sub get_arch () { _init_arch_release(); $arch }
sub get_release () { _init_arch_release(); $release }
sub get_host () {
- my $h;
- if (open my $f, '/proc/sys/kernel/hostname') {
- $h = <$f>;
- close $f;
- } else {
- $h = $ENV{HOSTNAME} || `/bin/hostname`;
- }
+ my $h = cat_('/proc/sys/kernel/hostname') || $ENV{HOSTNAME} || `/bin/hostname`;
chomp $h;
$h;
}