summaryrefslogtreecommitdiffstats
path: root/libvncclient
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 /libvncclient
parentbdde3f92279dce5e706846f908b065a16ad4f14a (diff)
downloadlibvncserver-c652b55f744862f84a846cf460f48f29b13cf74b.zip
libvncserver-c652b55f744862f84a846cf460f48f29b13cf74b.tar.gz
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>
Diffstat (limited to 'libvncclient')
-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;
}
OpenPOWER on IntegriCloud