Return the peer_pid properly to the caller
authorRonnie Sahlberg <ronniesahlberg@gmail.com>
Tue, 6 Dec 2011 02:15:41 +0000 (13:15 +1100)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Tue, 6 Dec 2011 02:16:15 +0000 (13:16 +1100)
(This used to be ctdb commit 0f15a2c65db8f8b4ac0d5ad2755b9aa3c2a8b279)

ctdb/common/system_aix.c
ctdb/common/system_linux.c

index c17598a3af8cddc623e9d6210ca72c94ff76dbf4..388e943de0b79f735218d4c7e46745744e9c088c 100644 (file)
@@ -368,7 +368,7 @@ int ctdb_get_peer_pid(const int fd, pid_t *peer_pid)
        socklen_t crl = sizeof(struct peercred_struct);
        int ret;
        if ((ret = getsockopt(fd, SOL_SOCKET, SO_PEERID, &cr, &crl) == 0)) {
-               peer_pid = cr.pid;
+               *peer_pid = cr.pid;
        }
        return ret;
 }
index cb26dcd654bf676693e585455f624c8c6e6d480f..464daef9ad12339ee7e783744dc2117e0c953af5 100644 (file)
@@ -570,7 +570,7 @@ int ctdb_get_peer_pid(const int fd, pid_t *peer_pid)
        socklen_t crl = sizeof(struct ucred);
        int ret;
        if ((ret = getsockopt(fd, SOL_SOCKET, SO_PEERCRED, &cr, &crl) == 0)) {
-               peer_pid = cr.pid;
+               *peer_pid = cr.pid;
        }
        return ret;
 }