summaryrefslogtreecommitdiff
path: root/libntp/work_thread.c
diff options
context:
space:
mode:
Diffstat (limited to 'libntp/work_thread.c')
-rw-r--r--libntp/work_thread.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/libntp/work_thread.c b/libntp/work_thread.c
index 433290c4c9a7a..03a5647bea36b 100644
--- a/libntp/work_thread.c
+++ b/libntp/work_thread.c
@@ -56,6 +56,17 @@
# define THREAD_MAXSTACKSIZE THREAD_MINSTACKSIZE
#endif
+/* need a good integer to store a pointer... */
+#ifndef UINTPTR_T
+# if defined(UINTPTR_MAX)
+# define UINTPTR_T uintptr_t
+# elif defined(UINT_PTR)
+# define UINTPTR_T UINT_PTR
+# else
+# define UINTPTR_T size_t
+# endif
+#endif
+
#ifdef SYS_WINNT
@@ -66,7 +77,7 @@ static BOOL same_os_sema(const sem_ref obj, void * osobj);
#else
-# define thread_exit(c) pthread_exit((void*)(size_t)(c))
+# define thread_exit(c) pthread_exit((void*)(UINTPTR_T)(c))
# define tickle_sem sem_post
void * blocking_thread(void *);
static void block_thread_signals(sigset_t *);
@@ -374,7 +385,9 @@ send_blocking_resp_internal(
if (empty)
{
# ifdef WORK_PIPE
- write(c->resp_write_pipe, "", 1);
+ if (1 != write(c->resp_write_pipe, "", 1))
+ msyslog(LOG_WARNING, "async resolver: %s",
+ "failed to notify main thread!");
# else
tickle_sem(c->responses_pending);
# endif