Linux-Trace-Devel Archive on
 help / color / Atom feed
From: Steven Rostedt <>
To: ""  <>
Cc: "Uhanov, Kirill" <>
Subject: [PATCH] trace-cmd: Fix typo in use of file descriptor in conditional
Date: Wed, 4 Sep 2019 07:55:00 -0400
Message-ID: <20190904075500.6c296198@oasis.local.home> (raw)

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);

                 reply index

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publically to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190904075500.6c296198@oasis.local.home \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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

Newsgroup available over NNTP:

AGPL code for this site: git clone public-inbox