summaryrefslogtreecommitdiff
path: root/perlio.c
diff options
context:
space:
mode:
authorNick Ing-Simmons <nik@tiuk.ti.com>2000-11-25 21:26:54 +0000
committerNick Ing-Simmons <nik@tiuk.ti.com>2000-11-25 21:26:54 +0000
commit24c23ab4f49a594279883afef247c728d1f5a636 (patch)
tree9ae4d36ee829aef06abaa8ff5d6c90d1de40487b /perlio.c
parenta77df51f3c9319336e0ec43ad003b02a0111d2af (diff)
parentcf829ab07ccc67cf02ca41d6f870136b64d83833 (diff)
downloadperl-24c23ab4f49a594279883afef247c728d1f5a636.tar.gz
Integrate mainline.
p4raw-id: //depot/perlio@7859
Diffstat (limited to 'perlio.c')
-rw-r--r--perlio.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/perlio.c b/perlio.c
index 5674674bde..65b2358382 100644
--- a/perlio.c
+++ b/perlio.c
@@ -1449,8 +1449,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