diff options
author | dscho <dscho> | 2005-12-09 13:56:25 +0000 |
---|---|---|
committer | dscho <dscho> | 2005-12-09 13:56:25 +0000 |
commit | 3a8d4bdbe6d264d8f93c75dc62f61ec41e9e7462 (patch) | |
tree | 850cf3f85d3247a445f5daa9283840aa4cd507a5 | |
parent | 065e2ebb7e4f342a7ceb71216f2e9417cbbdd5f6 (diff) | |
download | libtdevnc-3a8d4bdbe6d264d8f93c75dc62f61ec41e9e7462.tar.gz libtdevnc-3a8d4bdbe6d264d8f93c75dc62f61ec41e9e7462.zip |
work around write() returning ENOENT on Solaris 2.7
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | configure.ac | 8 | ||||
-rw-r--r-- | libvncclient/sockets.c | 6 | ||||
-rwxr-xr-x | libvncserver/sockets.c | 3 |
4 files changed, 20 insertions, 1 deletions
@@ -1,3 +1,7 @@ +2005-12-08 "Mazin, Malvina" <[email protected]> + * configure.ac, libvncserver/sockets.c: on Solaris 2.7, write may + return ENOENT when it really means EAGAIN. + 2005-12-07 Giampiero Giancipoli <[email protected]> * libvncclient/vncviewer.c: plug memory leaks diff --git a/configure.ac b/configure.ac index abb338a..5fe134d 100644 --- a/configure.ac +++ b/configure.ac @@ -360,6 +360,14 @@ AM_CONDITIONAL(LINUX, test -c /dev/vcsa1) AC_CHECK_HEADER(ApplicationServices/ApplicationServices.h, HAVE_OSX="true") AM_CONDITIONAL(OSX, test "$HAVE_OSX" = "true") +# On Solaris 2.7, write() returns ENOENT when it really means EAGAIN +AH_TEMPLATE(ENOENT_WORKAROUND, [work around when write() returns ENOENT but does not mean it]) +case `(uname -sr) 2>/dev/null` in + "SunOS 5.7") + AC_DEFINE(ENOENT_WORKAROUND) + ;; +esac + # Check for rpm SOURCES path printf "checking for rpm sources path... " RPMSOURCEDIR="NOT-FOUND" diff --git a/libvncclient/sockets.c b/libvncclient/sockets.c index 6ee5a9d..aca38aa 100644 --- a/libvncclient/sockets.c +++ b/libvncclient/sockets.c @@ -217,7 +217,11 @@ WriteToRFBServer(rfbClient* client, char *buf, int n) j = write(client->sock, buf + i, (n - i)); if (j <= 0) { if (j < 0) { - if (errno == EWOULDBLOCK || errno == EAGAIN) { + if (errno == EWOULDBLOCK || +#ifdef LIBVNCSERVER_ENOENT_WORKAROUND + errno == ENOENT || +#endif + errno == EAGAIN) { FD_ZERO(&fds); FD_SET(client->sock,&fds); diff --git a/libvncserver/sockets.c b/libvncserver/sockets.c index ca8b995..a225131 100755 --- a/libvncserver/sockets.c +++ b/libvncserver/sockets.c @@ -447,6 +447,9 @@ rfbReadExactTimeout(rfbClientPtr cl, char* buf, int len, int timeout) if (errno == EINTR) continue; +#ifdef LIBVNCSERVER_ENOENT_WORKAROUND + if (errno != ENOENT) +#endif if (errno != EWOULDBLOCK && errno != EAGAIN) { return n; } |