From: Mathieu Desnoyers Date: Thu, 23 Feb 2012 15:02:02 +0000 (-0500) Subject: Freebsd creds: do not overwrite recv len X-Git-Tag: v2.0.0-rc3~37 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=9e89c9310ef10784981c363bce03339030c2ed99;p=lttng-tools.git Freebsd creds: do not overwrite recv len Signed-off-by: Mathieu Desnoyers --- diff --git a/src/common/sessiond-comm/sessiond-comm.c b/src/common/sessiond-comm/sessiond-comm.c index 20baaaf7b..c2b76f37a 100644 --- a/src/common/sessiond-comm/sessiond-comm.c +++ b/src/common/sessiond-comm/sessiond-comm.c @@ -541,10 +541,13 @@ ssize_t lttcomm_recv_creds_unix_sock(int sock, void *buf, size_t len, memcpy(creds, CMSG_DATA(cmptr), sizeof_cred); #elif defined(__FreeBSD__) - ret = getpeereid(sock, &creds->uid, &creds->gid); - if (ret != 0) { - return ret; - } + { + int peer_ret; + + peer_ret = getpeereid(sock, &creds->uid, &creds->gid); + if (peer_ret != 0) { + return peer_ret; + } #else #error "Please implement credential support for your OS." #endif /* __linux__ */