summaryrefslogtreecommitdiffstats
path: root/sockets.c
diff options
context:
space:
mode:
authordscho <dscho>2004-05-05 19:42:27 +0000
committerdscho <dscho>2004-05-05 19:42:27 +0000
commitf5cfa4bc8d73f16e963f4a2aa99f63614f7da758 (patch)
tree1feb70ded7d43c476d077d75fc1b9171797e93f6 /sockets.c
parent1c7ca906f7971bc45a90f425d5d8754ddd5eb1d7 (diff)
downloadlibtdevnc-f5cfa4bc8d73f16e963f4a2aa99f63614f7da758.tar.gz
libtdevnc-f5cfa4bc8d73f16e963f4a2aa99f63614f7da758.zip
prevent segmentation fault when requested area is too big; if select is interrupted while WriteExact, just try again.
Diffstat (limited to 'sockets.c')
-rw-r--r--sockets.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sockets.c b/sockets.c
index 9086326..cea1898 100644
--- a/sockets.c
+++ b/sockets.c
@@ -499,7 +499,9 @@ WriteExact(cl, buf, len)
tv.tv_sec = 5;
tv.tv_usec = 0;
n = select(sock+1, NULL, &fds, NULL /* &fds */, &tv);
- if (n < 0) {
+ if (n < 0) {
+ if(errno==EINTR)
+ continue;
rfbLogPerror("WriteExact: select");
UNLOCK(cl->outputMutex);
return n;