X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=m4%2Fisapipe.m4;h=6bf92218e4621c852e1a6c2849ca7b86697ad07e;hb=3458f09caac5234831a315d073344fc898dde077;hp=1f0673666ac6cc270d3eba0a1ea696457d30f978;hpb=42d1eda5dcce2d68deab7a642e7f29bcd7144a0d;p=gnulib.git diff --git a/m4/isapipe.m4 b/m4/isapipe.m4 index 1f0673666..6bf92218e 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-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -24,50 +24,50 @@ AC_DEFUN([gl_PREREQ_ISAPIPE], [gl_cv_pipes_are_fifos], [AC_RUN_IFELSE( [AC_LANG_SOURCE( - [[#include - #include - #include - #include - #ifndef S_ISFIFO - #define S_ISFIFO(m) 0 - #endif - #ifndef S_ISSOCK - #define S_ISSOCK(m) 0 - #endif - int - main (int argc, char **argv) - { - int fd[2]; - struct stat st; - if (pipe (fd) != 0 || fstat (fd[0], &st) != 0) - return 1; - if (2 <= argc && argv[1][0] == '-') - { - char const *yesno = (S_ISFIFO (st.st_mode) ? "yes" : "no"); - if (st.st_nlink <= 1) - { - long int i = st.st_nlink; - if (i != st.st_nlink) - return 1; - printf ("%s (%ld)\n", yesno, i); - } - else - { - unsigned long int i = st.st_nlink; - if (i != st.st_nlink) - return 1; - printf ("%s (%lu)\n", yesno, i); - } - } - else - { - if (! S_ISFIFO (st.st_mode) && ! S_ISSOCK (st.st_mode)) - return 1; - } - return 0; - }]])], + [[#include + #include + #include + #include + #ifndef S_ISFIFO + #define S_ISFIFO(m) 0 + #endif + #ifndef S_ISSOCK + #define S_ISSOCK(m) 0 + #endif + int + main (int argc, char **argv) + { + int fd[2]; + struct stat st; + if (pipe (fd) != 0 || fstat (fd[0], &st) != 0) + return 1; + if (2 <= argc && argv[1][0] == '-') + { + char const *yesno = (S_ISFIFO (st.st_mode) ? "yes" : "no"); + if (st.st_nlink <= 1) + { + long int i = st.st_nlink; + if (i != st.st_nlink) + return 1; + printf ("%s (%ld)\n", yesno, i); + } + else + { + unsigned long int i = st.st_nlink; + if (i != st.st_nlink) + return 1; + printf ("%s (%lu)\n", yesno, i); + } + } + else + { + if (! S_ISFIFO (st.st_mode) && ! S_ISSOCK (st.st_mode)) + return 1; + } + return 0; + }]])], [gl_cv_pipes_are_fifos=`./conftest$ac_exeext -` - test -z "$gl_cv_pipes_are_fifos" && gl_cv_pipes_are_fifos=no], + test -z "$gl_cv_pipes_are_fifos" && gl_cv_pipes_are_fifos=no], [gl_cv_pipes_are_fifos=unknown], [gl_cv_pipes_are_fifos=cross-compiling])])