Fix: event notifier create protocol order issue
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 18 Dec 2020 22:28:04 +0000 (17:28 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 18 Dec 2020 22:28:04 +0000 (17:28 -0500)
sessiond needs to send the additional command payload before awaiting
reply from UST.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I4d046e3fd2f334d728d4310ceb2b003f6bf0abed

liblttng-ust-ctl/ustctl.c

index 07267aed122ff469591b3062f628d5ecbfbbe89a..80661a3fa0e748d22eea8bbe249b8defaf461406 100644 (file)
@@ -579,7 +579,7 @@ int ustctl_create_event_notifier(int sock, struct lttng_ust_event_notifier *even
        lum.cmd = LTTNG_UST_EVENT_NOTIFIER_CREATE;
        lum.u.event_notifier.len = sizeof(*event_notifier);
 
-       ret = ustcomm_send_app_cmd(sock, &lum, &lur);
+       ret = ustcomm_send_app_msg(sock, &lum);
        if (ret) {
                free(event_notifier_data);
                return ret;
@@ -592,6 +592,11 @@ int ustctl_create_event_notifier(int sock, struct lttng_ust_event_notifier *even
                else
                        return -EIO;
        }
+       ret = ustcomm_recv_app_reply(sock, &lur, lum.handle, lum.cmd);
+       if (ret) {
+               free(event_notifier_data);
+               return ret;
+       }
        event_notifier_data->handle = lur.ret_val;
        DBG("received event_notifier handle %u", event_notifier_data->handle);
        *_event_notifier_data = event_notifier_data;
This page took 0.026757 seconds and 4 git commands to generate.