work around write() returning ENOENT on Solaris 2.7

pull/1/head
dscho 19 years ago
parent 065e2ebb7e
commit 3a8d4bdbe6

@ -1,3 +1,7 @@
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;
}

Loading…
Cancel
Save