Whamcloud - gitweb
LU-17000 utils: Fix check after return from fopen() 86/53686/2
authorArshad Hussain <arshad.hussain@aeoncomputing.com>
Tue, 16 Jan 2024 10:22:54 +0000 (15:52 +0530)
committerOleg Drokin <green@whamcloud.com>
Sun, 4 Feb 2024 08:32:05 +0000 (08:32 +0000)
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 <arshad.hussain@aeoncomputing.com>
Change-Id: I04bd207582d421cc3744e7b0f4298e738502edbe
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/53686
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Timothy Day <timday@amazon.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/utils/ofd_access_log_reader.c

index cf72d9e..051b76f 100644 (file)
@@ -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));
                        }