From 809dc2811860434a76e4f10cb9f05d938148090c Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Sat, 20 Aug 2011 14:11:00 -0400 Subject: [PATCH] thread_manage_apps: update and comment socket handling Signed-off-by: Mathieu Desnoyers --- ltt-sessiond/main.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/ltt-sessiond/main.c b/ltt-sessiond/main.c index abd4e087f..70c194b22 100644 --- a/ltt-sessiond/main.c +++ b/ltt-sessiond/main.c @@ -859,10 +859,10 @@ static void *thread_manage_apps(void *data) } /* - * Basic recv here to handle the very simple data - * that the libust send to register (reg_msg). + * Using message-based transmissions to ensure we don't + * have to deal with partially received messages. */ - ret = recv(sock, ®_msg, sizeof(reg_msg), 0); + ret = lttcomm_recv_unix_sock(sock, ®_msg, sizeof(reg_msg)); if (ret < 0) { perror("recv"); continue; @@ -871,6 +871,11 @@ static void *thread_manage_apps(void *data) /* Add application to the global traceable list */ if (reg_msg.reg == 1) { /* Registering */ + /* + * TODO: socket should be either passed to a + * listener thread (for more messages) or + * closed. It currently leaks. + */ ret = register_traceable_app(reg_msg.pid, reg_msg.uid); if (ret < 0) { /* register_traceable_app only return an error with -- 2.34.1