summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libvncclient/rfbproto.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libvncclient/rfbproto.c b/libvncclient/rfbproto.c
index f9386ed..fb724f5 100644
--- a/libvncclient/rfbproto.c
+++ b/libvncclient/rfbproto.c
@@ -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;
}