]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
build: avoid build failure without sys/mtio.h
authorPádraig Brady <P@draigBrady.com>
Sun, 10 Dec 2017 03:05:32 +0000 (19:05 -0800)
committerPádraig Brady <P@draigBrady.com>
Mon, 11 Dec 2017 01:13:18 +0000 (17:13 -0800)
* 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.

m4/jm-macros.m4
src/dd.c
src/shred.c

index 399f69b32de544febdb5205099b9593b1776c92d..5aef4baf4d785391e3a58477fc1a2ebe417f0bf6 100644 (file)
@@ -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
index 7b3d2fd37748532e33b77a9323663a2458bbb87e..789811680a2e8c14fa0b7e4d8bdfebf1c79be1ee 100644 (file)
--- 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 <sys/mtio.h>
 
index b1f0b64b226f6dbc464d50374a24d26ad9cfbb2f..30e3e8c4490d7150c3b179ab037797fb8cb5cfb6 100644 (file)
@@ -80,7 +80,7 @@
 #include <assert.h>
 #include <setjmp.h>
 #include <sys/types.h>
-#ifdef __linux__
+#if defined __linux__ && HAVE_SYS_MTIO_H
 # include <sys/mtio.h>
 #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.  */