Commit 3a8d4bdb authored by dscho's avatar dscho

work around write() returning ENOENT on Solaris 2.7

parent 065e2ebb
2005-12-08 "Mazin, Malvina" <Malvina.Mazin@kla-tencor.com>
* configure.ac, libvncserver/sockets.c: on Solaris 2.7, write may
return ENOENT when it really means EAGAIN.
2005-12-07 Giampiero Giancipoli <giampiero.giancipoli@fredreggiane.com>
* libvncclient/vncviewer.c: plug memory leaks
......
......@@ -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"
......
......@@ -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);
......
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment