]> git.ipfire.org Git - thirdparty/xz.git/commitdiff
Revert "xz: Use pipe2() if available."
authorLasse Collin <lasse.collin@tukaani.org>
Mon, 20 Apr 2015 16:59:18 +0000 (19:59 +0300)
committerLasse Collin <lasse.collin@tukaani.org>
Mon, 20 Apr 2015 17:17:48 +0000 (20:17 +0300)
This reverts commit 7a11c4a8e5e15f13d5fa59233b3172e65428efdd.
It is a problem when libc has pipe2() but the kernel is too
old to have pipe2() and thus pipe2() fails. In xz it's pointless
to have a fallback for non-functioning pipe2(); it's better to
avoid pipe2() completely.

Thanks to Michael Fox for the bug report.

configure.ac
src/xz/file_io.c

index aa68e33b02b8112f62ae2ba3075547c4d4379df4..970712ddef11180785a571c2d26e757b6323b703 100644 (file)
@@ -650,8 +650,8 @@ gl_GETOPT
 # Find the best function to set timestamps.
 AC_CHECK_FUNCS([futimens futimes futimesat utimes utime], [break])
 
-# These are nice to have but not mandatory.
-AC_CHECK_FUNCS([posix_fadvise pipe2])
+# This is nice to have but not mandatory.
+AC_CHECK_FUNCS([posix_fadvise])
 
 TUKLIB_PROGNAME
 TUKLIB_INTEGER
index 8a5e0453bf87f878a29d8145555810bf7a0694c4..e5a29925d97645718a87f82b55903324595ddf6c 100644 (file)
@@ -95,13 +95,7 @@ io_init(void)
        // we are root.
        warn_fchown = geteuid() == 0;
 
-       // Create a pipe for the self-pipe trick. If pipe2() is available,
-       // we can avoid the fcntl() calls.
-#      ifdef HAVE_PIPE2
-       if (pipe2(user_abort_pipe, O_NONBLOCK))
-               message_fatal(_("Error creating a pipe: %s"),
-                               strerror(errno));
-#      else
+       // Create a pipe for the self-pipe trick.
        if (pipe(user_abort_pipe))
                message_fatal(_("Error creating a pipe: %s"),
                                strerror(errno));
@@ -114,7 +108,6 @@ io_init(void)
                        message_fatal(_("Error creating a pipe: %s"),
                                        strerror(errno));
        }
-#      endif
 #endif
 
 #ifdef __DJGPP__