From: Frank Kardel Date: Sat, 20 Jul 2013 10:48:50 +0000 (+0000) Subject: ntp_io.c, work_thread.c: X-Git-Tag: NTP_4_2_7P374~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c89693bb6cb284de85e7d29b15d7c31ab6056df3;p=thirdparty%2Fntp.git ntp_io.c, work_thread.c: [Bug 2425] keep init_socket_sig() within ntp_io.c to avoid interference with sntp's way of doing i/o bk: 51ea6b12vHqY3JkQ16c7SdYeuCCCdg --- diff --git a/libntp/work_thread.c b/libntp/work_thread.c index 9c313333c..cf41de9c4 100644 --- a/libntp/work_thread.c +++ b/libntp/work_thread.c @@ -13,7 +13,6 @@ #include #endif -#include "iosignal.h" #include "ntp_stdlib.h" #include "ntp_malloc.h" #include "ntp_syslog.h" @@ -450,9 +449,6 @@ start_blocking_thread_internal( "start_blocking_thread: fcntl(F_SETFL, O_NONBLOCK) %m"); exit(1); } -#if HAVE_SIGNALED_IO - init_socket_sig(c->resp_read_pipe); -#endif (*addremove_io_fd)(c->resp_read_pipe, c->ispipe, FALSE); pthread_attr_init(&thr_attr); pthread_attr_setdetachstate(&thr_attr, PTHREAD_CREATE_DETACHED); diff --git a/ntpd/ntp_io.c b/ntpd/ntp_io.c index 25bfec4e0..a84fec331 100644 --- a/ntpd/ntp_io.c +++ b/ntpd/ntp_io.c @@ -317,7 +317,7 @@ static int cmp_addr_distance(const sockaddr_u *, */ #if !defined(HAVE_IO_COMPLETION_PORT) static inline int read_network_packet (SOCKET, struct interface *, l_fp); -void ntpd_addremove_io_fd (int, int, int); +static void ntpd_addremove_io_fd (int, int, int); #ifdef REFCLOCK static inline int read_refclock_packet (SOCKET, struct refclockio *, l_fp); #endif @@ -455,6 +455,11 @@ ntpd_addremove_io_fd( ) { UNUSED_ARG(is_pipe); + +#ifdef HAVE_SIGNALED_IO + init_socket_sig(fd); +#endif /* not HAVE_SIGNALED_IO */ + maintain_activefds(fd, remove_it); }