X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Futils.c;h=2ff57cd1465c6071eb0d89705b061ef3dafac05f;hp=85a1f0203ae0e9088653271192d13172bf03f566;hb=6cd525e813795a1d5e38feac8dedf2c73ffb1274;hpb=33b141366b29aa086ecb8d06808d7ba91f83cb1e diff --git a/src/bin/lttng-sessiond/utils.c b/src/bin/lttng-sessiond/utils.c index 85a1f0203..2ff57cd14 100644 --- a/src/bin/lttng-sessiond/utils.c +++ b/src/bin/lttng-sessiond/utils.c @@ -32,34 +32,30 @@ int ht_cleanup_pipe[2] = { -1, -1 }; */ int notify_thread_pipe(int wpipe) { - int ret; + ssize_t ret; /* Ignore if the pipe is invalid. */ if (wpipe < 0) { return 0; } - do { - ret = write(wpipe, "!", 1); - } while (ret < 0 && errno == EINTR); - if (ret < 0) { + ret = lttng_write(wpipe, "!", 1); + if (ret < 1) { PERROR("write poll pipe"); } - return ret; + return (int) ret; } void ht_cleanup_push(struct lttng_ht *ht) { - int ret; + ssize_t ret; int fd = ht_cleanup_pipe[1]; if (fd < 0) return; - do { - ret = write(fd, &ht, sizeof(ht)); - } while (ret < 0 && errno == EINTR); - if (ret < 0 || ret != sizeof(ht)) { + ret = lttng_write(fd, &ht, sizeof(ht)); + if (ret < sizeof(ht)) { PERROR("write ht cleanup pipe %d", fd); if (ret < 0) { ret = -errno;