[PATCH 4/8] rt-migrate-test.c: Suppress warning

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

src/rt-migrate-test/rt-migrate-test.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/rt-migrate-test/rt-migrate-test.c b/src/rt-migrate-test/rt-migrate-test.c
index 8afe083..d7c0bf3 100644
--- a/src/rt-migrate-test/rt-migrate-test.c
+++ b/src/rt-migrate-test/rt-migrate-test.c
@@ -61,6 +61,7 @@ static void ftrace_write(const char *fmt, ...)
{
va_list ap;
int n;
+ int ret;

if (mark_fd < 0)
return;
@@ -69,7 +70,9 @@ static void ftrace_write(const char *fmt, ...)
n = vsnprintf(buff, BUFSIZ, fmt, ap);
va_end(ap);

- write(mark_fd, buff, n);
+ ret = write(mark_fd, buff, n);
+ if (ret < 0)
+ perror("ftrace_write failed");
}

#define nano2sec(nan) (nan / 1000000000ULL)
--
2.48.1