From 0e512e6ae3146fcf3ce2427c8c36937d708d149b Mon Sep 17 00:00:00 2001 From: David Timber Date: Tue, 8 Sep 2020 19:46:44 +0930 Subject: * Fix bug in pth_poll: wrong use of FD_SET() causing undefined behaviour * Fix bug in proone: loading ns pool from dvault for resolv * Fix bug in htbt: improper handling of stream in htbt_relay_child() * Switch back to _POSIX_C_SOURCE=200112L --- src/pth.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/pth.h') diff --git a/src/pth.h b/src/pth.h index 3b0d708..0ede191 100644 --- a/src/pth.h +++ b/src/pth.h @@ -25,5 +25,16 @@ void prne_init_worker (prne_worker_t *w); void prne_free_worker (prne_worker_t *w); void prne_fin_worker (prne_worker_t *w); +/* Workaround for bug in GNU Pth +* Calling pth_poll() with pollfd element whose fd is negative value results in +* undefined behaviour as stated in POSIX(FD_SET() with invalid value is +* undefined). GNU Pth uses FD_SET() with invalid values on purpose to achieve +* something. +*/ +int prne_pth_poll ( + struct pollfd *pfd, + const nfds_t nfs, + const int timeout, + pth_event_t ev); void prne_pth_cv_notify (pth_mutex_t *lock, pth_cond_t *cond, bool broadcast); pth_time_t prne_pth_tstimeout (const struct timespec ts); -- cgit