From: "Uhanov, Kirill" <kirill.uhanov@xxxxxxxxx> 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@xxxxxxxxx> Signed-off-by: Steven Rostedt (VMware) <rostedt@xxxxxxxxxxx> --- 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);
![]() |