nixos/switch-to-configuration: Clean perl code

oct() is recommended by perlcritic and the rest was unused.
This commit is contained in:
Janne Heß 2021-12-05 18:45:44 +01:00
parent 50a0f33c2a
commit 3693e8b093
No known key found for this signature in database
GPG Key ID: 69165158F05265DF

View File

@ -24,7 +24,7 @@ my $reloadByActivationFile = "/run/nixos/activation-reload-list";
my $dryRestartByActivationFile = "/run/nixos/dry-activation-restart-list"; my $dryRestartByActivationFile = "/run/nixos/dry-activation-restart-list";
my $dryReloadByActivationFile = "/run/nixos/dry-activation-reload-list"; my $dryReloadByActivationFile = "/run/nixos/dry-activation-reload-list";
make_path("/run/nixos", { mode => 0755 }); make_path("/run/nixos", { mode => oct(755) });
my $action = shift @ARGV; my $action = shift @ARGV;
@ -484,7 +484,7 @@ unlink($startListFile);
# Print failed and new units. # Print failed and new units.
my (@failed, @new, @restarting); my (@failed, @new);
my $activeNew = getActiveUnits; my $activeNew = getActiveUnits;
while (my ($unit, $state) = each %{$activeNew}) { while (my ($unit, $state) = each %{$activeNew}) {
if ($state->{state} eq "failed") { if ($state->{state} eq "failed") {