From 59492c96503d37cdf47a5c806fdd1038d8a81c72 Mon Sep 17 00:00:00 2001 From: Aristarkh Zagorodnikov Date: Fri, 1 Nov 2024 09:35:57 +0000 Subject: [PATCH] Try to fix "Use of uninitialized value $sdev in right bitshift" potentially encountered because of missing map --- needrestart | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/needrestart b/needrestart index cad58c37..80cbe7b0 100755 --- a/needrestart +++ b/needrestart @@ -573,6 +573,12 @@ if(defined($opt_l)) { # get on-disk info my ($sdev, $sinode) = stat($testp); + unless($sdev) { + unless($nrconf{skip_mapfiles} == -1) { + print STDERR "$LOGPREF #$pid map stat for $testp failed: $!\n" if($nrconf{verbosity} > 1); + } + next; + } my @sdevs = ( # glibc gnu_dev_* definition from sysmacros.h sprintf("%02x:%02x", (($sdev >> 8) & 0xfff) | (($sdev >> 32) & ~0xfff), (($sdev & 0xff) | (($sdev >> 12) & ~0xff))),