]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
ntp_io.c, work_thread.c:
authorFrank Kardel <kardel@ntp.org>
Sat, 20 Jul 2013 10:48:50 +0000 (10:48 +0000)
committerFrank Kardel <kardel@ntp.org>
Sat, 20 Jul 2013 10:48:50 +0000 (10:48 +0000)
  [Bug 2425] keep init_socket_sig() within ntp_io.c to avoid interference with sntp's way of doing i/o

bk: 51ea6b12vHqY3JkQ16c7SdYeuCCCdg

libntp/work_thread.c
ntpd/ntp_io.c

index 9c313333cb7756367ec9f8d8b68502fecf5b8d9e..cf41de9c4e80af1507547186204ff40b8a5ef441 100644 (file)
@@ -13,7 +13,6 @@
 #include <pthread.h>
 #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);
index 25bfec4e0afd155e98ac26b137834b73bfd71726..a84fec33103c2f5ec7e6d9f136485d5844722e08 100644 (file)
@@ -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);
 }