From 418446732612a7d47c019cf839f09f7d86621b34 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Fri, 18 Dec 2020 17:28:04 -0500 Subject: [PATCH] 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 --- liblttng-ust-ctl/ustctl.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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; -- 2.34.1