]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
Remove kernel version check from rtc code
authorMiroslav Lichvar <mlichvar@redhat.com>
Mon, 6 Jun 2011 19:32:38 +0000 (21:32 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Mon, 6 Jun 2011 19:33:59 +0000 (21:33 +0200)
It should work with all currently supported kernels (>= 2.2.0).

rtc_linux.c
sys_linux.c
sys_linux.h

index 7f53da8b46db7d0d110afb47f10637431660847b..2308cc8fc4c0cd4717c2182ded1f8f69eb021531 100644 (file)
@@ -507,62 +507,6 @@ write_coefs_to_file(int valid,time_t ref_time,double offset,double rate)
 int
 RTC_Linux_Initialise(void)
 {
-  int major, minor, patch;
-
-  /* Check whether we can support the real time clock.
-
-     Linux 1.2.x - haven't checked yet
-
-     Linux 1.3.x - don't know, haven't got a system to look at
-
-     Linux 2.0.x - For x<=31, using any variant of the adjtimex() call
-     sets the kernel into a mode where the RTC was updated every 11
-     minutes.  The only way to escape this is to use settimeofday().
-     Since we need to have sole control over the RTC to be able to
-     measure its drift rate, and there is no 'notify' callback to warn
-     you that the kernel is going to do this, I can't see a way to
-     support this.
-
-     Linux 2.0.x - For x>=32 the adjtimex()/RTC behaviour was
-     modified, so that as long as the STA_UNSYNC flag is set the RTC
-     is left alone.  This is the mode we exploit here, so that the RTC
-     continues to go its own sweet way, unless we make updates to it
-     from this module.
-
-     Linux 2.1.x - don't know, haven't got a system to look at.
-
-     Linux 2.2.x, 2.3.x and 2.4.x are believed to be OK for all
-     patch levels
-
-     */
-
-  SYS_Linux_GetKernelVersion(&major, &minor, &patch);
-
-  /* Obviously this test can get more elaborate when we know about
-     more system types. */
-  if (major != 2) {
-    return 0;
-  } else {
-    switch (minor) {
-      case 0:
-        if (patch <= 31) {
-          return 0;
-        }
-        break;
-      case 1:
-        return 0;
-        break;
-      case 2:
-      case 3:
-      case 4:
-      case 5:
-      case 6:
-      case 7:
-      case 8:
-        break; /* OK for all patch levels */
-    } 
-  }
-
   /* Setup details depending on configuration options */
   setup_config();
 
index a0321e7e348ee96d45316a32207cf137f7ef61c9..8b3bcfc8e50319aedb41bdf576aef0616c357c4e 100644 (file)
@@ -1087,16 +1087,6 @@ SYS_Linux_Finalise(void)
 
 /* ================================================== */
 
-void
-SYS_Linux_GetKernelVersion(int *major, int *minor, int *patchlevel)
-{
-  *major = version_major;
-  *minor = version_minor;
-  *patchlevel = version_patchlevel;
-}
-
-/* ================================================== */
-
 #ifdef FEAT_LINUXCAPS
 void
 SYS_Linux_DropRoot(char *user)
index 0df1cb1dbd47d16b5cb8edae19d70fda57132cb7..46caf358a5aa8d6590f3e73ad724013fb6b339c7 100644 (file)
@@ -31,8 +31,6 @@ extern void SYS_Linux_Initialise(void);
 
 extern void SYS_Linux_Finalise(void);
 
-extern void SYS_Linux_GetKernelVersion(int *major, int *minor, int *patchlevel);
-
 extern void SYS_Linux_DropRoot(char *user);
 
 extern void SYS_Linux_MemLockAll(int LockAll);