Undo the SOCKS workarounds, instead start using PerlIO
[p5sagit/p5-mst-13.2.git] / perlio.c
index 69aba4b..3c8c339 100644 (file)
--- a/perlio.c
+++ b/perlio.c
@@ -1368,8 +1368,12 @@ PerlIOStdio_tell(PerlIO *f)
 IV
 PerlIOStdio_close(PerlIO *f)
 {
+ int optval, optlen = sizeof(int);
  FILE *stdio = PerlIOSelf(f,PerlIOStdio)->stdio;
- return fclose(stdio);
+ return(
+   (getsockopt(PerlIO_fileno(f), SOL_SOCKET, SO_TYPE, (char *)&optval, &optlen) < 0) ? 
+       fclose(stdio) :
+       close(PerlIO_fileno(f)));
 }
 
 IV
@@ -2125,7 +2129,6 @@ PerlIOCrlf_get_cnt(PerlIO *f)
           {
            int code;
            dTHX;
-           Perl_warn(aTHX_ __FUNCTION__ " f=%p CR @ end of buffer",f);
            b->ptr++;               /* say we have read it as far as flush() is concerned */
            b->buf++;               /* Leave space an front of buffer */
            b->bufsiz--;            /* Buffer is thus smaller */