summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Beier <dontmind@freeshell.org>2009-10-02 10:50:18 +0200
committerJohannes Schindelin <johannes.schindelin@gmx.de>2009-10-02 10:50:18 +0200
commitc652b55f744862f84a846cf460f48f29b13cf74b (patch)
treeba0c0710203e5e05c90ba060e3726969ac118b6f
parentbdde3f92279dce5e706846f908b065a16ad4f14a (diff)
downloadlibtdevnc-c652b55f.tar.gz
libtdevnc-c652b55f.zip
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>
-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;
}