[PATCH 1/8] rt-utils.c: Suppress warning

Cheng-Yang Chou
2025-07-12T13:42:41Z

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