From: Juergen Perlinger Date: Thu, 16 May 2019 19:09:12 +0000 (+0200) Subject: [Bug 3515] Refactor ntpdmain() dispatcher loop and group common code X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d3f2e185adf257e873bf36016276dea4c118c91b;p=thirdparty%2Fntp.git [Bug 3515] Refactor ntpdmain() dispatcher loop and group common code bk: 5cddb558OWI1Xg601U39bGnT192Vfw --- diff --git a/ChangeLog b/ChangeLog index 11b80fb62..236f25e1d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,8 @@ * [Bug 3517] Reducing build noise * [Bug 3516] Require tooling from this decade - patch by Philipp Prindeville +* [Bug 3515] Refactor ntpdmain() dispatcher loop and group common code + - patch by Philipp Prindeville * [Bug 3511] Get rid of AC_LANG_SOURCE() warnings - patch by Philipp Prindeville * [Bug 3510] Flatten out the #ifdef nesting in ntpdmain() diff --git a/ntpd/ntpd.c b/ntpd/ntpd.c index d3b323fec..e3595c0e3 100644 --- a/ntpd/ntpd.c +++ b/ntpd/ntpd.c @@ -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;