From: Gurusamy Sarathy Date: Sun, 12 Mar 2000 11:27:38 +0000 (+0000) Subject: don't bother testing if we can flush all handles when fflush(stdin) X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b354742d52f39f966b03f3a190224ead373a843c;p=p5sagit%2Fp5-mst-13.2.git don't bother testing if we can flush all handles when fflush(stdin) shows the pipe bug p4raw-id: //depot/perl@5676 --- 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 <