Fix: lttng-ctl: deserialize on orderly shutdown of sessiond
[lttng-tools.git] / src / lib / lttng-ctl / lttng-ctl.c
index 001abffcd925705fbcee43a613ed055e2cea50c7..1c51eedc7814ff4879a844303b280200ae2e6fe2 100644 (file)
@@ -211,6 +211,8 @@ static int recv_data_sessiond(void *buf, size_t len)
 {
        int ret;
 
+       assert(len > 0);
+
        if (!connected) {
                ret = -LTTNG_ERR_NO_SESSIOND;
                goto end;
@@ -219,6 +221,8 @@ static int recv_data_sessiond(void *buf, size_t len)
        ret = lttcomm_recv_unix_sock(sessiond_socket, buf, len);
        if (ret < 0) {
                ret = -LTTNG_ERR_FATAL;
+       } else if (ret == 0) {
+               ret = -LTTNG_ERR_NO_SESSIOND;
        }
 
 end:
This page took 0.023384 seconds and 4 git commands to generate.