]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
hwclock: Don't use asm/io.h if sys/io.h can't be found
authorJosiah Worcester <josiahw@gmail.com>
Wed, 8 Jun 2011 22:52:48 +0000 (16:52 -0600)
committerKarel Zak <kzak@redhat.com>
Tue, 14 Jun 2011 12:16:07 +0000 (14:16 +0200)
[kzak@redhat.com: - check for obsolete asm/io.h in configure.ac]

Signed-off-by: Josiah Worcester <josiahw@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
configure.ac
hwclock/cmos.c

index 3524623e670dc388628305dae79422a89cd71546..52eade9e1137fbec9f09be8f25d92d51a7affdb7 100644 (file)
@@ -135,6 +135,7 @@ AC_CHECK_HEADERS(
         netinet/in.h \
        rpcsvc/nfs_prot.h \
        stdlib.h \
+       asm/io.h \
        sys/disk.h \
        sys/disklabel.h \
        sys/ioctl.h \
index 947b21bea2bb2dcf4696b86f3c46521c728fa658..0178ef7d30b636c103ace17c9db79d54c6036309 100644 (file)
 #include "nls.h"
 
 #if defined(__i386__)
-#ifdef HAVE_SYS_IO_H
-#include <sys/io.h>
-#else
-#include <asm/io.h>            /* for inb, outb */
-#endif
+
+# ifdef HAVE_SYS_IO_H
+#   include <sys/io.h>
+# elif defined(HAVE_ASM_IO_H)
+#  include <asm/io.h>  /* for inb, outb */
+# else
+/* Disable cmos access; we can no longer use asm/io.h, since
+ * the kernel does not export that header. */
+#  undef __i386__
+void outb(int a, int b){}
+int inb(int c){ return 0; }
+# endif
+
 #elif defined(__alpha__)
 /* <asm/io.h> fails to compile, probably because of u8 etc */
 extern unsigned int     inb(unsigned long port);