Fix IsUnixSocket()

This is a pure functionality fix: according to its manpage, stat()
returns 0 on success. Checking for a return value of zero fixes
incorrect results of IsUnixSocket().

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
pull/1/head
Christian Beier 15 years ago committed by Johannes Schindelin
parent bdde3f9227
commit c652b55f74

@ -348,7 +348,7 @@ static rfbBool
IsUnixSocket(const char *name)
{
struct stat sb;
if(stat(name, &sb) && (sb.st_mode & S_IFMT) == S_IFSOCK)
if(stat(name, &sb) == 0 && (sb.st_mode & S_IFMT) == S_IFSOCK)
return TRUE;
return FALSE;
}

Loading…
Cancel
Save