trace-cmd: Fix typo in use of file descriptor in conditional
diff mbox series

Message ID 20190904075500.6c296198@oasis.local.home
State Accepted
Commit ed1b47c748d306c78961883ec325703307e4606e
Headers show
Series
  • trace-cmd: Fix typo in use of file descriptor in conditional
Related show

Commit Message

Steven Rostedt Sept. 4, 2019, 11:55 a.m. UTC
From: "Uhanov, Kirill" <kirill.uhanov@intel.com>

tracecmd_create_buffer_recorder_maxkb() opens a file and uses fd2 as
the variable name to store the descriptor but the proceeding check on
the status of the opened file uses the variable name fd instead.

Signed-off-by: Kirill Uhanov <kirill.uhanov@intel.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---

Patch
diff mbox series

diff --git a/lib/trace-cmd/trace-recorder.c b/lib/trace-cmd/trace-recorder.c
index 0bd0657..650b259 100644
--- a/lib/trace-cmd/trace-recorder.c
+++ b/lib/trace-cmd/trace-recorder.c
@@ -244,7 +244,7 @@  tracecmd_create_buffer_recorder_maxkb(const char *file, int cpu, unsigned flags,
 		goto out;
 
 	fd2 = open(file2, O_RDWR | O_CREAT | O_TRUNC | O_LARGEFILE, 0644);
-	if (fd < 0)
+	if (fd2 < 0)
 		goto err;
 
 	recorder = tracecmd_create_buffer_recorder_fd2(fd, fd2, cpu, flags, buffer, maxkb);