From: Pádraig Brady Date: Sun, 10 Dec 2017 03:05:32 +0000 (-0800) Subject: build: avoid build failure without sys/mtio.h X-Git-Tag: v8.29~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8fb32039bcc137baec9bf80c206077a73cec8878;p=thirdparty%2Fcoreutils.git build: avoid build failure without sys/mtio.h * m4/jm-macros.m4: Check for the header. * src/dd.c: Avoid the workaround where the header is not available (on non glibc systems). * src/shred.c: Likewise. --- diff --git a/m4/jm-macros.m4 b/m4/jm-macros.m4 index 399f69b32d..5aef4baf4d 100644 --- a/m4/jm-macros.m4 +++ b/m4/jm-macros.m4 @@ -211,6 +211,7 @@ AC_DEFUN([gl_CHECK_ALL_HEADERS], paths.h priv.h stropts.h + sys/mtio.h sys/param.h sys/systeminfo.h syslog.h diff --git a/src/dd.c b/src/dd.c index 7b3d2fd377..789811680a 100644 --- a/src/dd.c +++ b/src/dd.c @@ -1720,7 +1720,7 @@ advance_input_offset (uintmax_t offset) The offending behavior has been confirmed with an Exabyte SCSI tape drive accessed via /dev/nst0 on both Linux 2.2.17 and 2.4.16 kernels. */ -#ifdef __linux__ +#if defined __linux__ && HAVE_SYS_MTIO_H # include diff --git a/src/shred.c b/src/shred.c index b1f0b64b22..30e3e8c449 100644 --- a/src/shred.c +++ b/src/shred.c @@ -80,7 +80,7 @@ #include #include #include -#ifdef __linux__ +#if defined __linux__ && HAVE_SYS_MTIO_H # include #endif @@ -391,7 +391,7 @@ dorewind (int fd, struct stat const *st) { if (S_ISCHR (st->st_mode)) { -#ifdef __linux__ +#if defined __linux__ && HAVE_SYS_MTIO_H /* In the Linux kernel, lseek does not work on tape devices; it returns a randomish value instead. Try the low-level tape rewind operation first. */