Linux-Trace-Devel Archive on
 help / color / Atom feed
* [PATCH] trace-cmd: Fix typo in use of file descriptor in conditional
@ 2019-09-04 11:55 Steven Rostedt
  0 siblings, 0 replies; only message in thread
From: Steven Rostedt @ 2019-09-04 11:55 UTC (permalink / raw)
  To: linux-trace-devel; +Cc: Uhanov, Kirill

From: "Uhanov, Kirill" <>

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 <>
Signed-off-by: Steven Rostedt (VMware) <>
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);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-04 11:55 [PATCH] trace-cmd: Fix typo in use of file descriptor in conditional Steven Rostedt

Linux-Trace-Devel Archive on

Archives are clonable:
	git clone --mirror linux-trace-devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-trace-devel linux-trace-devel/ \
	public-inbox-index linux-trace-devel

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone