Freebsd creds: do not overwrite recv len
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 23 Feb 2012 15:02:02 +0000 (10:02 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 23 Feb 2012 15:02:02 +0000 (10:02 -0500)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
src/common/sessiond-comm/sessiond-comm.c

index 20baaaf7b0dfafa2cd660d492eb0162367625dbe..c2b76f37a0401886cc8b5b8fe8ffd3263b3f83e8 100644 (file)
@@ -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__ */
This page took 0.034815 seconds and 4 git commands to generate.