Commit 057854f8 authored by Ricardo B. Marlière's avatar Ricardo B. Marlière Committed by Steven Rostedt
Browse files

ktest: Avoid undef warning when WARNINGS_FILE is unset

check_buildlog() probes $warnings_file with -f even when WARNINGS_FILE is
not configured. Perl warns about the uninitialized value and adds noise to
the test log, which can hide the output we actually care about.

Check that WARNINGS_FILE is defined before testing whether the file exists.

Cc: John Hawley <warthog9@eaglescrag.net>
Cc: Andrea Righi <arighi@nvidia.com>
Cc: Marcos Paulo de Souza <mpdesouza@suse.com>
Cc: Matthieu Baerts <matttbe@kernel.org>
Cc: Fernando Fernandez Mancera <fmancera@suse.de>
Cc: Pedro Falcato <pfalcato@suse.de>
Link: https://patch.msgid.link/20260307-ktest-fixes-v1-1-565d412f4925@suse.com


Fixes: 4283b169 ("ktest: Add make_warnings_file and process full warnings")
Signed-off-by: default avatarRicardo B. Marlière <rbm@suse.com>
Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
parent 1f318b96
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2508,7 +2508,7 @@ sub check_buildlog {
    my $save_no_reboot = $no_reboot;
    $no_reboot = 1;

    if (-f $warnings_file) {
    if (defined($warnings_file) && -f $warnings_file) {
	open(IN, $warnings_file) or
	    dodie "Error opening $warnings_file";