From: Josiah Worcester Date: Wed, 8 Jun 2011 22:52:48 +0000 (-0600) Subject: hwclock: Don't use asm/io.h if sys/io.h can't be found X-Git-Tag: v2.20-rc1~170 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=363ce07137ca8e5be1ff24763e34679b9dd9c3e2;p=thirdparty%2Futil-linux.git hwclock: Don't use asm/io.h if sys/io.h can't be found [kzak@redhat.com: - check for obsolete asm/io.h in configure.ac] Signed-off-by: Josiah Worcester Signed-off-by: Karel Zak --- diff --git a/configure.ac b/configure.ac index 3524623e67..52eade9e11 100644 --- a/configure.ac +++ b/configure.ac @@ -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 \ diff --git a/hwclock/cmos.c b/hwclock/cmos.c index 947b21bea2..0178ef7d30 100644 --- a/hwclock/cmos.c +++ b/hwclock/cmos.c @@ -50,11 +50,19 @@ #include "nls.h" #if defined(__i386__) -#ifdef HAVE_SYS_IO_H -#include -#else -#include /* for inb, outb */ -#endif + +# ifdef HAVE_SYS_IO_H +# include +# elif defined(HAVE_ASM_IO_H) +# include /* 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__) /* fails to compile, probably because of u8 etc */ extern unsigned int inb(unsigned long port);