From bc820a5148c9d318f78869f7678b4cb98a7f66e2 Mon Sep 17 00:00:00 2001 From: Jamie Cameron Date: Sat, 28 Sep 2024 15:13:24 -0700 Subject: [PATCH] Instead of passing a param to check_reboot_required that causes it to return 0, just don't call it --- package-updates/package-updates-lib.pl | 5 +---- system-status/system-status-lib.pl | 8 +++++--- webmin/webmin-lib.pl | 3 ++- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-updates/package-updates-lib.pl b/package-updates/package-updates-lib.pl index ef21f4fa8..a5e5ff042 100644 --- a/package-updates/package-updates-lib.pl +++ b/package-updates/package-updates-lib.pl @@ -677,13 +677,10 @@ return $mode eq 'updates' || $mode eq 'security' ? &list_possible_updates($nocache) : &list_available($nocache); } -# check_reboot_required([no-collect]) +# check_reboot_required() # Returns 1 if the package system thinks a reboot is needed -# If the no-collect flag is set, then check won't happen sub check_reboot_required { -my ($no_collect) = @_; -return 0 if ($no_collect); if ($gconfig{'os_type'} eq 'debian-linux') { if (-e "/var/run/reboot-required") { return 1; diff --git a/system-status/system-status-lib.pl b/system-status/system-status-lib.pl index 04ded90d6..8baddba06 100755 --- a/system-status/system-status-lib.pl +++ b/system-status/system-status-lib.pl @@ -66,11 +66,13 @@ if (&foreign_check("mount")) { # Available package updates if (&foreign_installed("package-updates") && $config{'collect_pkgs'}) { &foreign_require("package-updates"); - my $poss_collect_blocked = (&indexof('package-updates', @{$modskip}) > -1); + my $poss_collect_blocked = &indexof('package-updates', @$modskip) >= 0; my $poss_current = !$poss_collect_blocked ? 2 : undef; - my @poss = &package_updates::list_possible_updates(undef, $poss_collect_blocked); + my @poss = &package_updates::list_possible_updates( + undef, $poss_collect_blocked); $info->{'poss'} = \@poss; - $info->{'reboot'} = &package_updates::check_reboot_required($poss_collect_blocked); + $info->{'reboot'} = $poss_collect_blocked ? 0 : + &package_updates::check_reboot_required(); } # CPU and drive temps diff --git a/webmin/webmin-lib.pl b/webmin/webmin-lib.pl index 13ba55313..ae7682d9d 100755 --- a/webmin/webmin-lib.pl +++ b/webmin/webmin-lib.pl @@ -1429,7 +1429,8 @@ if (&foreign_check("package-updates") && &foreign_available("init")) { } } } - if ($allow_reboot_required && &package_updates::check_reboot_required()) { + if ($allow_reboot_required && + &package_updates::check_reboot_required()) { push(@notifs, &ui_form_start("@{[&get_webprefix()]}/init/reboot.cgi"). $text{'notif_reboot'}."

\n".