[PATCH 2/8] pmqtest.c: Suppress warning

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

src/pmqtest/pmqtest.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/pmqtest/pmqtest.c b/src/pmqtest/pmqtest.c
index 04e36a1..eb20baa 100644
--- a/src/pmqtest/pmqtest.c
+++ b/src/pmqtest/pmqtest.c
@@ -75,6 +75,7 @@ void *pmqthread(void *param)
int policy = SCHED_FIFO;
struct sched_param schedp;
struct timespec ts;
+ int ret;

memset(&schedp, 0, sizeof(schedp));
schedp.sched_priority = par->priority;
@@ -189,7 +190,10 @@ void *pmqthread(void *param)
int tracing_enabled =
open(tracing_enabled_file, O_WRONLY);
if (tracing_enabled >= 0) {
- write(tracing_enabled, "0", 1);
+ ret = write(tracing_enabled, "0", 1);
+ if (ret < 0)
+ fatal("Could not write to %s: %s\n",
+ tracing_enabled_file, strerror(errno));
close(tracing_enabled);
} else
fatal("Could not access %s\n", tracing_enabled_file);
--
2.48.1