From: Michael Jeanson Date: Thu, 27 Oct 2022 21:05:23 +0000 (-0400) Subject: Fix: C++ syntax of FreeBSD compat code X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=5219e670edb63d5a4b34e095475045e6540f461b;p=lttng-tools.git Fix: C++ syntax of FreeBSD compat code Change-Id: I4c463bb965c34692718dadd1731f2a1fab7a1248 Signed-off-by: Michael Jeanson Signed-off-by: Jérémie Galarneau --- diff --git a/src/common/compat/socket.hpp b/src/common/compat/socket.hpp index 599998ef5..66f3c3af3 100644 --- a/src/common/compat/socket.hpp +++ b/src/common/compat/socket.hpp @@ -228,10 +228,11 @@ int lttng_get_unix_socket_peer_pid(int socket_fd, pid_t *pid) { int ret; struct xucred sock_creds = {}; + socklen_t sock_creds_len = (socklen_t) sizeof(sock_creds); /* Only available in FreeBSD 13.0 and up. */ ret = getsockopt(socket_fd, SOL_LOCAL, LOCAL_PEERCRED, &sock_creds, - &((socklen_t) {sizeof(sock_creds)})); + &sock_creds_len); if (ret) { goto end; }