Use lttng_read/lttng_write wrappers
[lttng-tools.git] / src / bin / lttng-sessiond / utils.c
index 85a1f0203ae0e9088653271192d13172bf03f566..2ff57cd1465c6071eb0d89705b061ef3dafac05f 100644 (file)
@@ -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;
This page took 0.025346 seconds and 4 git commands to generate.