Fix: C++ syntax of FreeBSD compat code
authorMichael Jeanson <mjeanson@efficios.com>
Thu, 27 Oct 2022 21:05:23 +0000 (17:05 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 28 Oct 2022 20:43:10 +0000 (16:43 -0400)
Change-Id: I4c463bb965c34692718dadd1731f2a1fab7a1248
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/common/compat/socket.hpp

index 599998ef5f6b63de04e355af59fbded74bcd87fc..66f3c3af3df1b5453de0ea410b1e0908c4518435 100644 (file)
@@ -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;
        }
This page took 0.026602 seconds and 4 git commands to generate.