X-Git-Url: https://erislabs.net/gitweb/?a=blobdiff_plain;f=m4%2Fisapipe.m4;h=76402ff89a209b492ddcc7795af08dddc3fbb340;hb=b58d8aacabf74bae9e628f924474f2038c18a9df;hp=8f7999cbd7779097cc81bf8a935fcccc7b3af70a;hpb=2d4d7d9d00fe33b6f5291e00a30b6c1016775b74;p=gnulib.git diff --git a/m4/isapipe.m4 b/m4/isapipe.m4 index 8f7999cbd..76402ff89 100644 --- a/m4/isapipe.m4 +++ b/m4/isapipe.m4 @@ -1,6 +1,6 @@ # Test whether a file descriptor is a pipe. -dnl Copyright (C) 2006, 2009 Free Software Foundation, Inc. +dnl Copyright (C) 2006, 2009-2011 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -39,8 +39,10 @@ AC_DEFUN([gl_PREREQ_ISAPIPE], { int fd[2]; struct stat st; - if (pipe (fd) != 0 || fstat (fd[0], &st) != 0) + if (pipe (fd) != 0) return 1; + if (fstat (fd[0], &st) != 0) + return 2; if (2 <= argc && argv[1][0] == '-') { char const *yesno = (S_ISFIFO (st.st_mode) ? "yes" : "no"); @@ -48,21 +50,21 @@ AC_DEFUN([gl_PREREQ_ISAPIPE], { long int i = st.st_nlink; if (i != st.st_nlink) - return 1; + return 3; printf ("%s (%ld)\n", yesno, i); } else { unsigned long int i = st.st_nlink; if (i != st.st_nlink) - return 1; + return 4; printf ("%s (%lu)\n", yesno, i); } } else { if (! S_ISFIFO (st.st_mode) && ! S_ISSOCK (st.st_mode)) - return 1; + return 5; } return 0; }]])],