From 966c6bc7a2514737c04b579cdb4a985c99ae6658 Mon Sep 17 00:00:00 2001 From: Arshad Hussain Date: Tue, 16 Jan 2024 15:52:54 +0530 Subject: [PATCH] LU-17000 utils: Fix check after return from fopen() Return from fopen() for option 't' (trace) was checked with a different variable. This patch fixes this. Test-Parameters: trivial CoverityID: 397651 ("Copy-paste error") Signed-off-by: Arshad Hussain Change-Id: I04bd207582d421cc3744e7b0f4298e738502edbe Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/53686 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Timothy Day Reviewed-by: Andreas Dilger Reviewed-by: Oleg Drokin --- lustre/utils/ofd_access_log_reader.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lustre/utils/ofd_access_log_reader.c b/lustre/utils/ofd_access_log_reader.c index cf72d9e..051b76f 100644 --- a/lustre/utils/ofd_access_log_reader.c +++ b/lustre/utils/ofd_access_log_reader.c @@ -792,8 +792,8 @@ int main(int argc, char *argv[]) trace_file = stdout; } else { trace_file = fopen(optarg, "a"); - if (debug_file == NULL) - FATAL("cannot open debug file '%s': %s\n", + if (trace_file == NULL) + FATAL("cannot open trace file '%s': %s\n", optarg, strerror(errno)); } -- 1.8.3.1