client: enable cr_pid on FreeBSD >= 12.3
https://cgit.freebsd.org/src/commit/?id=925f44f33862908f9a2e72520a17af148c7d0db5 https://cgit.freebsd.org/src/commit/?id=2b61bda2c75f30f6eadd18fb891fd885e4c8d19d
This commit is contained in:
parent
0d855a28f2
commit
5ad91ae9da
1 changed files with 1 additions and 1 deletions
|
@ -40,7 +40,7 @@ static int get_peer(int fd, pid_t *pid, uid_t *uid, gid_t *gid) {
|
||||||
if (getsockopt(fd, 0, LOCAL_PEERCRED, &cred, &len) == -1) {
|
if (getsockopt(fd, 0, LOCAL_PEERCRED, &cred, &len) == -1) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
#if __FreeBSD_version >= 1300030
|
#if __FreeBSD_version >= 1300030 || (__FreeBSD_version >= 1202506 && __FreeBSD_version < 1300000)
|
||||||
*pid = cred.cr_pid;
|
*pid = cred.cr_pid;
|
||||||
#else
|
#else
|
||||||
*pid = -1;
|
*pid = -1;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue