From d9682409f759d18faf71ab4491030f2b29af79f1 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Fri, 11 Feb 2011 00:21:54 -0800 Subject: [PATCH 1/2] Fixed detection of nanosleep. --- protocols/vnc/configure.in | 1 + protocols/vnc/src/vnc_client.c | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/protocols/vnc/configure.in b/protocols/vnc/configure.in index 35d8c3fa..2080594c 100644 --- a/protocols/vnc/configure.in +++ b/protocols/vnc/configure.in @@ -18,6 +18,7 @@ AC_CHECK_LIB([vncclient], [rfbInitClient],, AC_MSG_ERROR("libvncclient is requir AC_CHECK_HEADERS([stdlib.h string.h syslog.h guacamole/client.h guacamole/guacio.h guacamole/protocol.h]) # Checks for library functions. +AC_CHECK_FUNCS([nanosleep]) AC_FUNC_MALLOC AC_CONFIG_FILES([Makefile]) diff --git a/protocols/vnc/src/vnc_client.c b/protocols/vnc/src/vnc_client.c index 6c374433..f66997cd 100644 --- a/protocols/vnc/src/vnc_client.c +++ b/protocols/vnc/src/vnc_client.c @@ -199,17 +199,17 @@ void guac_vnc_cut_text(rfbClient* client, const char* text, int textlen) { void vnc_guac_client_sleep(int millis) { -#ifdef nanosleep +#ifdef HAVE_NANOSLEEP struct timespec sleep_period; sleep_period.tv_sec = 0; sleep_period.tv_nsec = millis * 1000000L; nanosleep(&sleep_period, NULL); -#else -#ifdef Sleep +#elif defined(__MINGW32__) Sleep(millis) -#endif +#else +#warning No sleep/nanosleep function available. VNC client may not perform as expected. Consider editing the vnc_client.c to add support for your platform. #endif } From 78fa8ebbd766e158e45f1eddd921f376ffad1fca Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Thu, 17 Feb 2011 02:18:44 -0800 Subject: [PATCH 2/2] Removed one nanosleep() check - same change made twice --- protocols/vnc/configure.in | 1 - 1 file changed, 1 deletion(-) diff --git a/protocols/vnc/configure.in b/protocols/vnc/configure.in index dd5572d5..45a766e4 100644 --- a/protocols/vnc/configure.in +++ b/protocols/vnc/configure.in @@ -18,7 +18,6 @@ AC_CHECK_LIB([vncclient], [rfbInitClient],, AC_MSG_ERROR("libvncclient is requir AC_CHECK_HEADERS([stdlib.h string.h syslog.h guacamole/client.h guacamole/guacio.h guacamole/protocol.h]) # Checks for library functions. -AC_CHECK_FUNCS([nanosleep]) AC_FUNC_MALLOC AC_CHECK_FUNCS([nanosleep])