trace-cmd: Fix typo in use of file descriptor in conditional
PATCH 1/1 trace-cmd: Fix typo in use of file descriptor in conditional
From: "Uhanov, Kirill" <[email protected]>
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 <[email protected]>
Signed-off-by Steven Rostedt (VMware) <[email protected]>
---
lib/trace-cmd/trace-recorder.c +1 -1
@@ -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);