[ntp:bugs] [Bug 1861] Compilation error on tickadj.c

bugzilla-daemon at ntp.org bugzilla-daemon at ntp.org
Thu Mar 24 13:36:58 UTC 2011


http://bugs.ntp.org/show_bug.cgi?id=1861

Dave Hart <hart at ntp.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED

--- Comment #2 from Dave Hart <hart at ntp.org> 2011-03-24 13:36:58 UTC ---
(In reply to comment #0)
> ntp version 4.2.6p3
> However, becouse  PRESET_TICK is actually txc.tick and 
> the label txc is not defined for this main function in .../util/tickadj.c  a
> compilation error occure.
> 
> The only place where tcx is declared in .../util/tickadj.c is line 27 
> but this one is guarded by 
> 
> #ifdef HAVE___ADJTIMEX        /* Linux */
> 
> however the ./configure script does not set this define on my machine, 
> a matter of fact, the ./configure script does not even have code to do so.

I think it does.  See configure.ac:323

case "$host" in
 *-*-*linux*)
    AC_CHECK_FUNCS([__adjtimex __ntp_gettime])

> Perhaps the ./configure script should check if file sys/timex.h exist and 
> include it like this ion tickadj.c
> 
> ifdef HAVE_SYSTIMEX_H
> #include <sys/timex.h>
> struct timex txc;
> #endif

I think you're on the right track.  Please try editing tickadj.c so that
snippet looks like:

#ifdef HAVE_SYS_TIMEX_H
# include <sys/timex.h>
struct timex txc;
#endif

#ifdef HAVE___ADJTIMEX        /* Linux */

If that solves the compile issue, I do wonder if the resulting code will
actually work to adjust your systems' tick.  The code seems to assume any linux
will have both sys/timex.h and __adjtimex.

-- 
Configure bugmail: http://bugs.ntp.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


More information about the bugs mailing list