Cleanup: work-around clang unused result warning
[lttng-ust.git] / liblttng-ust-comm / lttng-ust-comm.c
index 3644a1628a7fc12af488f79764c11422cceb3d39..3a60ba1a4be09c6e4f9f543b31f274bdbea9d0f3 100644 (file)
@@ -116,11 +116,14 @@ int ustcomm_connect_unix_sock(const char *pathname)
        ret = connect(fd, (struct sockaddr *) &sun, sizeof(sun));
        if (ret < 0) {
                /*
-                * Don't print message on connect error, because connect
-                * is used in normal execution to detect if sessiond is
-                * alive.
+                * Don't print message on connect ENOENT error, because
+                * connect is used in normal execution to detect if
+                * sessiond is alive. ENOENT is when the unix socket
+                * file does not exist, and ECONNREFUSED is when the
+                * file exists but no sessiond is listening.
                 */
-               if (errno != ECONNREFUSED && errno != ECONNRESET)
+               if (errno != ECONNREFUSED && errno != ECONNRESET
+                               && errno != ENOENT)
                        PERROR("connect");
                ret = -errno;
                if (ret == -ECONNREFUSED || ret == -ECONNRESET)
@@ -543,10 +546,12 @@ int ustcomm_send_app_cmd(int sock,
  * expected var_len.
  */
 ssize_t ustcomm_recv_channel_from_sessiond(int sock,
-               void **_chan_data, uint64_t var_len)
+               void **_chan_data, uint64_t var_len,
+               int *_wakeup_fd)
 {
        void *chan_data;
-       ssize_t len;
+       ssize_t len, nr_fd;
+       int wakeup_fd;
 
        if (var_len > LTTNG_UST_CHANNEL_DATA_MAX_LEN) {
                len = -EINVAL;
@@ -562,6 +567,18 @@ ssize_t ustcomm_recv_channel_from_sessiond(int sock,
        if (len != var_len) {
                goto error_recv;
        }
+       /* recv wakeup fd */
+       nr_fd = ustcomm_recv_fds_unix_sock(sock, &wakeup_fd, 1);
+       if (nr_fd <= 0) {
+               if (nr_fd < 0) {
+                       len = nr_fd;
+                       goto error_recv;
+               } else {
+                       len = -EIO;
+                       goto error_recv;
+               }
+       }
+       *_wakeup_fd = wakeup_fd;
        *_chan_data = chan_data;
        return len;
 
@@ -814,7 +831,7 @@ int ustcomm_register_event(int sock,
                struct ustcomm_notify_event_reply r;
        } reply;
        size_t signature_len, fields_len, model_emf_uri_len;
-       struct ustctl_field *fields;
+       struct ustctl_field *fields = NULL;
        size_t nr_write_fields = 0;
        int ret;
 
This page took 0.027477 seconds and 4 git commands to generate.