From: Mathieu Desnoyers Date: Fri, 18 Dec 2020 22:28:04 +0000 (-0500) Subject: Fix: event notifier create protocol order issue X-Git-Tag: v2.13.0-rc1~399 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=418446732612a7d47c019cf839f09f7d86621b34;p=lttng-ust.git Fix: event notifier create protocol order issue sessiond needs to send the additional command payload before awaiting reply from UST. Signed-off-by: Mathieu Desnoyers Change-Id: I4d046e3fd2f334d728d4310ceb2b003f6bf0abed --- diff --git a/liblttng-ust-ctl/ustctl.c b/liblttng-ust-ctl/ustctl.c index 07267aed..80661a3f 100644 --- a/liblttng-ust-ctl/ustctl.c +++ b/liblttng-ust-ctl/ustctl.c @@ -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;