public inbox for linux-rt-users@vger.kernel.org
 help / color / mirror / Atom feed
From: Cheng-Yang Chou <yphbchou0911@gmail.com>
To: williams@redhat.com, jkacur@redhat.com
Cc: linux-rt-users@vger.kernel.org, jserv@ccns.ncku.edu.tw,
	yphbchou0911@gmail.com
Subject: [PATCH 1/8] rt-utils.c: Suppress warning
Date: Sat, 12 Jul 2025 21:42:06 +0800	[thread overview]
Message-ID: <20250712134213.58582-2-yphbchou0911@gmail.com> (raw)
In-Reply-To: <20250712134213.58582-1-yphbchou0911@gmail.com>

Signed-off-by: Cheng-Yang Chou <yphbchou0911@gmail.com>
---
 src/lib/rt-utils.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/lib/rt-utils.c b/src/lib/rt-utils.c
index 6bbd25a..18e515f 100644
--- a/src/lib/rt-utils.c
+++ b/src/lib/rt-utils.c
@@ -465,6 +465,7 @@ void tracemark(char *fmt, ...)
 {
 	va_list ap;
 	int len;
+	int ret;
 
 	/* bail out if we're not tracing */
 	/* or if the kernel doesn't support trace_mark */
@@ -476,10 +477,14 @@ void tracemark(char *fmt, ...)
 	va_end(ap);
 
 	/* write the tracemark message */
-	write(tracemark_fd, tracebuf, len);
+	ret = write(tracemark_fd, tracebuf, len);
+	if (ret != len)
+		warn("tracemark write failed");
 
 	/* now stop any trace */
-	write(trace_fd, "0\n", 2);
+	ret = write(trace_fd, "0\n", 2);
+	if (ret != 2)
+		warn("trace stop write failed");
 }
 
 void enable_trace_mark(void)
-- 
2.48.1


  reply	other threads:[~2025-07-12 13:42 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-12 13:42 [PATCH 0/8] Fix -Wunused-result warnings by checking return values Cheng-Yang Chou
2025-07-12 13:42 ` Cheng-Yang Chou [this message]
2025-07-25 18:04   ` [PATCH 1/8] rt-utils.c: Suppress warning John Kacur
2025-07-12 13:42 ` [PATCH 2/8] pmqtest.c: " Cheng-Yang Chou
2025-07-25 18:07   ` John Kacur
2025-07-12 13:42 ` [PATCH 3/8] ptsematest.c: " Cheng-Yang Chou
2025-07-25 18:09   ` John Kacur
2025-07-12 13:42 ` [PATCH 4/8] rt-migrate-test.c: " Cheng-Yang Chou
2025-07-25 18:10   ` John Kacur
2025-07-12 13:42 ` [PATCH 5/8] cyclicdeadline.c: " Cheng-Yang Chou
2025-07-12 13:42 ` [PATCH 6/8] deadline_test.c: " Cheng-Yang Chou
2025-07-12 13:42 ` [PATCH 7/8] sigwaittest.c: " Cheng-Yang Chou
2025-07-12 13:42 ` [PATCH 8/8] svsematest.c: " Cheng-Yang Chou
2025-07-25 18:16 ` [PATCH 0/8] Fix -Wunused-result warnings by checking return values John Kacur
2025-07-25 18:20   ` Cheng-Yang Chou

Reply instructions:

You may reply publicly 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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=20250712134213.58582-2-yphbchou0911@gmail.com \
    --to=yphbchou0911@gmail.com \
    --cc=jkacur@redhat.com \
    --cc=jserv@ccns.ncku.edu.tw \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=williams@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox