event/ServerSocket: fix get_remote_uid() error value

Must return -1 on error, not 0.  0 is root.
This commit is contained in:
Max Kellermann 2014-11-18 20:53:59 +01:00
parent 7e7b403043
commit 3f5f96ac91
1 changed files with 1 additions and 1 deletions

View File

@ -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