From c652b55f744862f84a846cf460f48f29b13cf74b Mon Sep 17 00:00:00 2001 From: Christian Beier Date: Fri, 2 Oct 2009 10:50:18 +0200 Subject: 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 --- libvncclient/rfbproto.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- cgit v1.2.3