X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=m4%2Fisapipe.m4;h=3f6ff91f502c6e18486e419b423f209f5a8d2a46;hb=9f6141ab3bc86bfe40bff58fae8094f16470649f;hp=6bf92218e4621c852e1a6c2849ca7b86697ad07e;hpb=b2e2010c7c902235b5efb5bd3c6529f61b093aa4;p=gnulib.git diff --git a/m4/isapipe.m4 b/m4/isapipe.m4 index 6bf92218e..3f6ff91f5 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-2010 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, @@ -11,9 +11,11 @@ dnl Written by Paul Eggert. AC_DEFUN([gl_ISAPIPE], [ # OpenVMS has isapipe already, so check for it. - AC_REPLACE_FUNCS([isapipe]) - if test $ac_cv_func_isapipe = no; then - gl_PREREQ_ISAPIPE + AC_CHECK_FUNCS([isapipe]) + if test $ac_cv_func_isapipe = yes; then + HAVE_ISAPIPE=1 + else + HAVE_ISAPIPE=0 fi ]) @@ -39,8 +41,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 +52,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; }]])],