Debian 12 / Perl 5.38 LFD not reading logs - *SOLUTION*
Posted: 04 Jul 2023, 05:01
Hi,
Following investigation there is a change in Perl 5.38 which breaks LFD.
https://perldoc.perl.org/perldelta#read ... -eof-flags
As soon as one of the log files causes an error (e.g. is simply not present), all future log file reads on any file will fail until the error is cleared.
I solved this by adding a clearerr call before each log read, which is in the LFD file and the function getlogfile (around line 2195 for the function start).
I amended the code as follows:
Now LFD reads the log files under Perl 5.38. Not sure if this has any side effects or might occur elsewhere, so use at your own risk.
Following investigation there is a change in Perl 5.38 which breaks LFD.
https://perldoc.perl.org/perldelta#read ... -eof-flags
As soon as one of the log files causes an error (e.g. is simply not present), all future log file reads on any file will fail until the error is cleared.
I solved this by adding a clearerr call before each log read, which is in the LFD file and the function getlogfile (around line 2195 for the function start).
I amended the code as follows:
Code: Select all
if (!defined($lffd[$lfn])) {
if (&openlogfile($logfile,$lfn)) {return undef}
}
$lffd[$lfn]->clearerr(); # <-- THIS IS THE NEW LINE
(undef, $ino, undef, undef, undef, undef, undef, $size, undef) = stat($logfile);