diff options
Diffstat (limited to 'perl-install/common.pm')
-rw-r--r-- | perl-install/common.pm | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/perl-install/common.pm b/perl-install/common.pm index d54eb9a2f..b3a6b05e5 100644 --- a/perl-install/common.pm +++ b/perl-install/common.pm @@ -429,11 +429,7 @@ sub getVarsFromSh($) { sub setVarsInSh { my ($file, $l, @fields) = @_; - @fields = keys %$l unless @fields; - - local *F; - open F, "> $_[0]" or die "cannot create config file $file"; - $l->{$_} and print F "$_=$l->{$_}\n" foreach @fields; + setVarsInShMode($file, 0777 ^ umask(), $l, @fields); } sub setVarsInShMode { @@ -441,7 +437,7 @@ sub setVarsInShMode { @fields = keys %$l unless @fields; local *F; - open F, "> $_[0]" or die "cannot create config file $file"; + open F, "> $file" or die "cannot create config file $file"; chmod $mod, $file; $l->{$_} and print F "$_=$l->{$_}\n" foreach @fields; } |