]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
[Bug 3515] Refactor ntpdmain() dispatcher loop and group common code
authorJuergen Perlinger <perlinger@ntp.org>
Thu, 16 May 2019 19:09:12 +0000 (21:09 +0200)
committerJuergen Perlinger <perlinger@ntp.org>
Thu, 16 May 2019 19:09:12 +0000 (21:09 +0200)
bk: 5cddb558OWI1Xg601U39bGnT192Vfw

ChangeLog
ntpd/ntpd.c

index 11b80fb62066e5d82aae4df742484487f371eef6..236f25e1deac2e7c3bb1c6e5a942e217828d952c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,8 @@
 * [Bug 3517] Reducing build noise <perlinger@ntp.org>
 * [Bug 3516] Require tooling from this decade <perlinger@ntp.org>
   - patch by Philipp Prindeville
+* [Bug 3515] Refactor ntpdmain() dispatcher loop and group common code <perlinger@ntp.org>
+  - patch by Philipp Prindeville
 * [Bug 3511] Get rid of AC_LANG_SOURCE() warnings <perlinger@ntp.org>
   - patch by Philipp Prindeville
 * [Bug 3510] Flatten out the #ifdef nesting in ntpdmain() <perlinger@ntp.org>
index d3b323feced6d48220b940ad4a5de8d4ea578f5a..e3595c0e3fb6b55ddb1c91b3916ebc93f51f8278 100644 (file)
@@ -779,7 +779,6 @@ ntpdmain(
 # if defined(HAVE_WORKING_FORK)
        long            wait_sync = 0;
        int             pipe_fds[2];
-       int             rc;
        int             exit_code;
 # endif        /* HAVE_WORKING_FORK*/
 # ifdef SCO5_CLOCK
@@ -973,7 +972,7 @@ ntpdmain(
 
 # ifdef HAVE_WORKING_FORK
                detach_from_terminal(pipe_fds, wait_sync, logfilename);
-# endif                /* HAVE_WORKING_FORK */
+# endif        /* HAVE_WORKING_FORK */
        }
 
 # ifdef SCO5_CLOCK
@@ -1364,24 +1363,20 @@ int scmp_sc[] = {
        ntservice_isup();
 #endif
 
-# ifdef HAVE_IO_COMPLETION_PORT
+# ifndef HAVE_IO_COMPLETION_PORT
+       BLOCK_IO_AND_ALARM();
+       was_alarmed = FALSE;
+# endif
 
        for (;;) {
 #if !defined(SIM) && defined(SIGDIE1)
                if (signalled)
                        finish_safe(signo);
 #endif
+# ifdef HAVE_IO_COMPLETION_PORT
                GetReceivedBuffers();
-# else /* normal I/O */
 
-       BLOCK_IO_AND_ALARM();
-       was_alarmed = FALSE;
-
-       for (;;) {
-#if !defined(SIM) && defined(SIGDIE1)
-               if (signalled)
-                       finish_safe(signo);
-#endif         
+# else /* normal I/O */
                if (alarm_flag) {       /* alarmed? */
                        was_alarmed = TRUE;
                        alarm_flag = FALSE;