X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=doc%2Fexamples%2Frotation%2Frotate-client-example.c;fp=doc%2Fexamples%2Frotation%2Frotate-client-example.c;h=86e5b04f25fc9a5cd55fcd9ca83bcad82c7b7833;hp=a5ee70da326c2181d8133af103e7d83eb57ecc6d;hb=5c7248cd5bce45bf64d563fb4e130a63bf345f11;hpb=cd9adb8b829564212158943a0d279bb35322ab30 diff --git a/doc/examples/rotation/rotate-client-example.c b/doc/examples/rotation/rotate-client-example.c index a5ee70da3..86e5b04f2 100644 --- a/doc/examples/rotation/rotate-client-example.c +++ b/doc/examples/rotation/rotate-client-example.c @@ -37,6 +37,7 @@ #include #include #include +#include #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; }