X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Futils.c;h=5ea337450ecf63e8fc1f19b6e7e336804e869f68;hb=6242251b39f531a2485b758edcb455e220267fdd;hp=ce2e97561f0170c3dbdb072370e79b1e5ec502ae;hpb=d14d33bf091e72b23b1f90ea18a0a01bed098b76;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/utils.c b/src/bin/lttng-sessiond/utils.c index ce2e97561..5ea337450 100644 --- a/src/bin/lttng-sessiond/utils.c +++ b/src/bin/lttng-sessiond/utils.c @@ -17,11 +17,7 @@ */ #define _GNU_SOURCE -#include -#include -#include #include -#include #include #include @@ -35,7 +31,14 @@ int notify_thread_pipe(int wpipe) { int ret; - ret = write(wpipe, "!", 1); + /* Ignore if the pipe is invalid. */ + if (wpipe < 0) { + return 0; + } + + do { + ret = write(wpipe, "!", 1); + } while (ret < 0 && errno == EINTR); if (ret < 0) { PERROR("write poll pipe"); }