diff options
author | Malcolm Beattie <mbeattie@sable.ox.ac.uk> | 1997-10-03 17:12:33 +0000 |
---|---|---|
committer | Malcolm Beattie <mbeattie@sable.ox.ac.uk> | 1997-10-03 17:12:33 +0000 |
commit | 968277801164b16eb55f9f8fd3162dc3b6226110 (patch) | |
tree | 9e3909d2149d62cac469cfb6d84bdfd4353dd19f /doio.c | |
parent | 5d3fdfebb3d34f909dfbefe2c2cdf38bab171cf9 (diff) | |
download | perl-968277801164b16eb55f9f8fd3162dc3b6226110.tar.gz |
Remove last traces of "tokenbuf as temp buffer" and removed it
from struct thread. Added missing thr->Tfoo defines for statbuf
and timesbuf and removed unused Tbuf field.
p4raw-id: //depot/perl@106
Diffstat (limited to 'doio.c')
-rw-r--r-- | doio.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -283,6 +283,7 @@ PerlIO *supplied_fp; } if (IoTYPE(io) && IoTYPE(io) != '|' && IoTYPE(io) != '-') { + dTHR; if (Fstat(PerlIO_fileno(fp),&statbuf) < 0) { (void)PerlIO_close(fp); goto say_false; @@ -297,8 +298,9 @@ PerlIO *supplied_fp; !statbuf.st_mode #endif ) { - Sock_size_t buflen = sizeof tokenbuf; - if (getsockname(PerlIO_fileno(fp), (struct sockaddr *)tokenbuf, + char tmpbuf[256]; + Sock_size_t buflen = sizeof tmpbuf; + if (getsockname(PerlIO_fileno(fp), (struct sockaddr *)tmpbuf, &buflen) >= 0 || errno != ENOTSOCK) IoTYPE(io) = 's'; /* some OS's return 0 on fstat()ed socket */ @@ -340,6 +342,7 @@ PerlIO *supplied_fp; #endif IoIFP(io) = fp; if (writing) { + dTHR; if (IoTYPE(io) == 's' || (IoTYPE(io) == '>' && S_ISCHR(statbuf.st_mode)) ) { if (!(IoOFP(io) = PerlIO_fdopen(PerlIO_fileno(fp),"w"))) { |