X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=doc%2Fexamples%2Frotation%2Frotate-client-example.c;h=86e5b04f25fc9a5cd55fcd9ca83bcad82c7b7833;hb=5c7248cd5bce45bf64d563fb4e130a63bf345f11;hp=a5ee70da326c2181d8133af103e7d83eb57ecc6d;hpb=f46376a14da2eb796690cb4e718e8b213839d6ea;p=lttng-tools.git 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; }