clang-tidy: add most bugprone warnings
[lttng-tools.git] / doc / examples / rotation / rotate-client-example.c
index a5ee70da326c2181d8133af103e7d83eb57ecc6d..86e5b04f25fc9a5cd55fcd9ca83bcad82c7b7833 100644 (file)
@@ -37,6 +37,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
+#include <assert.h>
 
 #define DEFAULT_DATA_AVAILABILITY_WAIT_TIME 200000 /* usec */
 
@@ -44,7 +45,10 @@ static volatile int quit = 0;
 
 static void sighandler(int signal __attribute__((unused)))
 {
-       printf("Signal caught, exiting\n");
+       const char msg[] = "Signal caught, exiting\n";
+       const int ret =  write(STDOUT_FILENO, msg, sizeof(msg));
+
+       assert(ret == 0); /* NOLINT assert is not async signal safe */
        quit = 1;
 }
 
This page took 0.023683 seconds and 4 git commands to generate.