retitle 578168 util-linux: make build with recent kernels
tags 578168 + patch
thanks

Hi,

please find attached a debdiff that works for me, or rather,
would work if I had the correct RTC driver compiled with the
kernel. The KDGHWCLK method is obsolete, no longer defined in
current kernel sources, and the old fallback code could never
have compiled at all.

Thanks,
//mirabilos
-- 
I believe no one can invent an algorithm. One just happens to hit upon it
when God enlightens him. Or only God invents algorithms, we merely copy them.
If you don't believe in God, just consider God as Nature if you won't deny
existence.              -- Coywolf Qi Hunt
diff -u util-linux-2.17.2/debian/changelog util-linux-2.17.2/debian/changelog
--- util-linux-2.17.2/debian/changelog
+++ util-linux-2.17.2/debian/changelog
@@ -1,3 +1,11 @@
+util-linux (2.17.2-3.3+m68k.1) unreleased; urgency=low
+
+  * hwclock/kd.c: if KDGHWCLK is not defined, even on m68k,
+    do not build this deprecated interface; the fallback code
+    was wrong and did not compile anyway.  Closes: #578168
+
+ -- Thorsten Glaser <t...@mirbsd.de>  Mon, 01 Nov 2010 15:05:20 +0000
+
 util-linux (2.17.2-3.3) unstable; urgency=low
 
   * Non-maintainer upload.
only in patch2:
unchanged:
--- util-linux-2.17.2.orig/hwclock/kd.c
+++ util-linux-2.17.2/hwclock/kd.c
@@ -2,14 +2,7 @@
 
 #include "clock.h"
 
-#ifndef __m68k__
-
-struct clock_ops *
-probe_for_kd_clock() {
-       return NULL;
-}
-
-#else /* __m68k__ */
+#ifdef __m68k__
 
 #include <unistd.h>            /* for close() */
 #include <fcntl.h>             /* for O_RDONLY */
@@ -19,26 +12,26 @@
 #include "nls.h"
 #include "usleep.h"
 
-static int con_fd = -1;                /* opened by probe_for_kd_clock() */
-                               /* never closed */
-static char *con_fd_filename;  /* usually "/dev/tty1" */
-
 /* Get defines for KDGHWCLK and KDSHWCLK (m68k) */
 #include <linux/kd.h>
-#ifndef KDGHWCLK
-#define KDGHWCLK        0x4B50     /* get hardware clock */
-#define KDSHWCLK        0x4B51     /* set hardware clock */
-struct hwclk_time {
-        unsigned        sec;    /* 0..59 */
-        unsigned        min;    /* 0..59 */
-        unsigned        hour;   /* 0..23 */
-        unsigned        day;    /* 1..31 */
-        unsigned        mon;    /* 0..11 */
-        unsigned        year;   /* 70... */
-        int             wday;   /* 0..6, 0 is Sunday, -1 means unknown/don't 
set */
-};
+
+/* Even on m68k, if KDGHWCLK (antique) is not defined, don't build this */
+
 #endif
 
+#if !defined(__m68k__) || !defined(KDGHWCLK)
+
+struct clock_ops *
+probe_for_kd_clock() {
+       return NULL;
+}
+
+#else /* __m68k__ && KDGHWCLK */
+
+static int con_fd = -1;                /* opened by probe_for_kd_clock() */
+                               /* never closed */
+static char *con_fd_filename;  /* usually "/dev/tty1" */
+
 static int
 synchronize_to_clock_tick_kd(void) {
 /*----------------------------------------------------------------------------
@@ -183,4 +176,4 @@
        }
        return ret;
 }
-#endif /* __m68k__ */
+#endif /* __m68k__ && KDGHWCLK */

Reply via email to