From b354742d52f39f966b03f3a190224ead373a843c Mon Sep 17 00:00:00 2001 From: Gurusamy Sarathy Date: Sun, 12 Mar 2000 11:27:38 +0000 Subject: [PATCH] don't bother testing if we can flush all handles when fflush(stdin) shows the pipe bug p4raw-id: //depot/perl@5676 --- Configure | 107 +++++++++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 75 insertions(+), 32 deletions(-) diff --git a/Configure b/Configure index 40a6169..053f227 100755 --- a/Configure +++ b/Configure @@ -12577,7 +12577,7 @@ main(int argc, char **argv) fprintf(stdout, "%s", buf); fflush(NULL); if (i == -1) - return 0; + return 0; bp = buf; } } @@ -12599,7 +12599,7 @@ EOM fflushNULL="$undef" fi fi - $rm -f core tryp.core core.tryp.* + $rm -f core tryp.c tryp.core core.tryp.* ;; '') $cat >&4 <&4 <tryp.c < +int +main(int argc, char **argv) +{ + char buf[1024]; + int i; + char *bp = buf; + while (1) { + while ((i = getc(stdin)) != -1 + && (*bp++ = i) != '\n' + && bp < &buf[1024]) + /* DO NOTHING */ ; + *bp = '\0'; + fprintf(stdout, "%s", buf); + fflush(stdin); + if (i == -1) + return 0; + bp = buf; + } +} +EOCP + set tryp + if eval $compile; then + $rm -f tryp.out + $cat tryp.c | ./tryp$exe_ext 2>/dev/null > tryp.out + if cmp tryp.c tryp.out >/dev/null 2>&1; then + $cat >&4 </dev/null - if $test -s try.out -a "X$?" = X42; then - fflushall="`$cat try.out`" - fi - fi - $rm -f core try.core core.try.* + : now check for fflushall behaviour case "$fflushall" in - x) $cat >&4 <&4 </dev/null + if $test -s try.out -a "X$?" = X42; then + fflushall="`$cat try.out`" + fi + fi + $rm -f core try.core core.try.* + case "$fflushall" in + x) $cat >&4 <&4 <&4 <&4 <&4 <&4 <