diff options
author | Tim Bunce <Tim.Bunce@ig.co.uk> | 1997-06-11 12:00:00 +1200 |
---|---|---|
committer | Tim Bunce <Tim.Bunce@ig.co.uk> | 1997-06-11 12:00:00 +1200 |
commit | 3e3baf6d63945cb64e829d6e5c70a7d00f3d3d03 (patch) | |
tree | 0143be655536dc428f4fa3cc7d01f6bcffe14c01 /pp_sys.c | |
parent | 08aa1457cd52a368c210ab76a3da91cfadabea1a (diff) | |
parent | 3458556dd685b1767b760a72bd2e9007b5c4575e (diff) | |
download | perl-3e3baf6d63945cb64e829d6e5c70a7d00f3d3d03.tar.gz |
[differences between cumulative patch application and perl5.004_01]perl-5.004_01
[editor's note: The changes between this and 5.004 were processed from
the m1t2 release, which was a bad idea as it was the _01 release which
had the final corrected attributions. The differences between the
various m*t* releases do that; I considered it most valuable just to
look at the _NN releases. Many patches have been separated out and/or
applied from the p5p archives nonetheless.]
Diffstat (limited to 'pp_sys.c')
-rw-r--r-- | pp_sys.c | 35 |
1 files changed, 33 insertions, 2 deletions
@@ -71,7 +71,7 @@ extern int h_errno; #endif #ifdef I_UTIME -# ifdef WIN32 +# ifdef _MSC_VER # include <sys/utime.h> # else # include <utime.h> @@ -469,8 +469,19 @@ PP(pp_binmode) else RETPUSHUNDEF; #else - if (setmode(PerlIO_fileno(fp), OP_BINARY) != -1) + if (setmode(PerlIO_fileno(fp), OP_BINARY) != -1) { +#if defined(WIN32) && defined(__BORLANDC__) + /* The translation mode of the stream is maintained independent + * of the translation mode of the fd in the Borland RTL (heavy + * digging through their runtime sources reveal). User has to + * set the mode explicitly for the stream (though they don't + * document this anywhere). GSAR 97-5-24 + */ + PerlIO_seek(fp,0L,0); + fp->flags |= _F_BIN; +#endif RETPUSHYES; + } else RETPUSHUNDEF; #endif @@ -1243,7 +1254,11 @@ PP(pp_sysread) #ifdef HAS_SOCKET if (op->op_type == OP_RECV) { char namebuf[MAXPATHLEN]; +#if defined(VMS_DO_SOCKETS) && defined(DECCRTL_SOCKETS) + bufsize = sizeof (struct sockaddr_in); +#else bufsize = sizeof namebuf; +#endif buffer = SvGROW(bufsv, length+1); /* 'offset' means 'flags' here */ length = recvfrom(PerlIO_fileno(IoIFP(io)), buffer, length, offset, @@ -1283,7 +1298,11 @@ PP(pp_sysread) #ifdef HAS_SOCKET__bad_code_maybe if (IoTYPE(io) == 's') { char namebuf[MAXPATHLEN]; +#if defined(VMS_DO_SOCKETS) && defined(DECCRTL_SOCKETS) + bufsize = sizeof (struct sockaddr_in); +#else bufsize = sizeof namebuf; +#endif length = recvfrom(PerlIO_fileno(IoIFP(io)), buffer+offset, length, 0, (struct sockaddr *)namebuf, &bufsize); } @@ -1368,6 +1387,7 @@ PP(pp_send) } else length = send(PerlIO_fileno(IoIFP(io)), buffer, blen, length); + #else else DIE(no_sock_func, "send"); @@ -1986,6 +2006,17 @@ PP(pp_getpeername) case OP_GETPEERNAME: if (getpeername(fd, (struct sockaddr *)SvPVX(sv), &len) < 0) goto nuts2; +#if defined(VMS_DO_SOCKETS) && defined (DECCRTL_SOCKETS) + { + static const char nowhere[] = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"; + /* If the call succeeded, make sure we don't have a zeroed port/addr */ + if (((struct sockaddr *)SvPVX(sv))->sa_family == AF_INET && + !memcmp((char *)SvPVX(sv) + sizeof(u_short), nowhere, + sizeof(u_short) + sizeof(struct in_addr))) { + goto nuts2; + } + } +#endif break; } #ifdef BOGUS_GETNAME_RETURN |