diff options
author | dscho <dscho> | 2003-07-31 16:48:23 +0000 |
---|---|---|
committer | dscho <dscho> | 2003-07-31 16:48:23 +0000 |
commit | 48029a3a0b854c50ef1b5e0b1cb27ba5f6220d9d (patch) | |
tree | 849e6c47158118d479544dd1cbcc1b4d47199060 | |
parent | ae5142bdbd98f8a196d166331fa193ea20599cd9 (diff) | |
download | libtdevnc-48029a3a0b854c50ef1b5e0b1cb27ba5f6220d9d.tar.gz libtdevnc-48029a3a0b854c50ef1b5e0b1cb27ba5f6220d9d.zip |
rfbLog can be overridden; EINTR on read/write means just try again
-rw-r--r-- | main.c | 4 | ||||
-rw-r--r-- | rfb/rfb.h | 3 | ||||
-rw-r--r-- | sockets.c | 6 |
3 files changed, 11 insertions, 2 deletions
@@ -59,7 +59,7 @@ void rfbLogEnable(int enabled) { */ void -rfbLog(const char *format, ...) +rfbDefaultLog(const char *format, ...) { va_list args; char buf[256]; @@ -82,6 +82,8 @@ rfbLog(const char *format, ...) UNLOCK(logMutex); } +rfbLogProc rfbLog=rfbDefaultLog; + void rfbLogPerror(const char *str) { rfbLog("%s: %s\n", str, strerror(errno)); @@ -729,7 +729,8 @@ extern rfbBool rfbProcessSizeArguments(int* width,int* height,int* bpp,int* argc /* main.c */ extern void rfbLogEnable(int enabled); -extern void rfbLog(const char *format, ...); +typedef void (*rfbLogProc)(const char *format, ...); +extern rfbLogProc rfbLog; extern void rfbLogPerror(const char *str); void rfbScheduleCopyRect(rfbScreenInfoPtr rfbScreen,int x1,int y1,int x2,int y2,int dx,int dy); @@ -415,6 +415,9 @@ ReadExactTimeout(rfbClientPtr cl, char* buf, int len, int timeout) #ifdef WIN32 errno = WSAGetLastError(); #endif + if (errno == EINTR) + continue; + if (errno != EWOULDBLOCK && errno != EAGAIN) { return n; } @@ -478,6 +481,9 @@ WriteExact(cl, buf, len) #ifdef WIN32 errno = WSAGetLastError(); #endif + if (errno == EINTR) + continue; + if (errno != EWOULDBLOCK && errno != EAGAIN) { UNLOCK(cl->outputMutex); return n; |