event/ServerSocket: fix get_remote_uid() error value
Must return -1 on error, not 0. 0 is root.
This commit is contained in:
parent
7e7b403043
commit
3f5f96ac91
|
@ -141,7 +141,7 @@ get_remote_uid(int fd)
|
|||
socklen_t len = sizeof (cred);
|
||||
|
||||
if (getsockopt(fd, SOL_SOCKET, SO_PEERCRED, &cred, &len) < 0)
|
||||
return 0;
|
||||
return -1;
|
||||
|
||||
return cred.uid;
|
||||
#else
|
||||
|
|
Loading…
Reference in New Issue