From: Chip Salzenberg Date: Mon, 23 Dec 1996 00:58:58 +0000 (+1200) Subject: Fixes for Interactive Unix X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=13826f2cf81099b832a12ff02c10a2f9d23cd6e5;p=p5sagit%2Fp5-mst-13.2.git Fixes for Interactive Unix (this is the same change as commit 1ab5d0547ab7398ea9e3e00b1c1b0f1f8ea0dd94, but as applied) --- diff --git a/hints/isc.sh b/hints/isc.sh index df745a9..5860acc 100644 --- a/hints/isc.sh +++ b/hints/isc.sh @@ -28,6 +28,9 @@ case "$cc" in ;; esac +# getsockname() and getpeername() return 256 for no good reason +ccflags="$ccflags -DBOGUS_GETNAME_RETURN=256" + # You can also include -D_SYSV3 to pick up "traditionally visible" # symbols hidden by name-space pollution rules. This raises some # compilation "redefinition" warnings, but they appear harmless. diff --git a/op.c b/op.c index 56624e3..619b675 100644 --- a/op.c +++ b/op.c @@ -186,7 +186,7 @@ pad_findlex(char *name, PADOFFSET newoff, U32 seq, CV* startcv, I32 cx_ix) if ((sv = svp[off]) && sv != &sv_undef && seq <= SvIVX(sv) && - seq > (I32)SvNVX(sv) && + seq > I_32(SvNVX(sv)) && strEQ(SvPVX(sv), name)) { I32 depth; @@ -277,7 +277,7 @@ char *name; if ((sv = svp[off]) && sv != &sv_undef && seq <= SvIVX(sv) && - seq > (I32)SvNVX(sv) && + seq > I_32(SvNVX(sv)) && strEQ(SvPVX(sv), name)) { return (PADOFFSET)off; diff --git a/pp_sys.c b/pp_sys.c index 5e096fe..72b8df5 100644 --- a/pp_sys.c +++ b/pp_sys.c @@ -121,7 +121,7 @@ static int dooneliner _((char *cmd, char *filename)); # endif /* no flock() or fcntl(F_SETLK,...) */ # ifdef FLOCK - static int FLOCK(int, int); + static int FLOCK _((int, int)); /* * These are the flock() constants. Since this sytems doesn't have @@ -1860,6 +1860,12 @@ PP(pp_getpeername) goto nuts2; break; } +#ifdef BOGUS_GETNAME_RETURN + /* Interactive Unix, getpeername() and getsockname() + does not return valid namelen */ + if (aint == BOGUS_GETNAME_RETURN) + aint = sizeof(struct sockaddr); +#endif SvCUR_set(sv,aint); *SvEND(sv) ='\0'; PUSHs(sv); diff --git a/universal.c b/universal.c index 476b60d..74d182d 100644 --- a/universal.c +++ b/universal.c @@ -198,6 +198,7 @@ XS(XS_UNIVERSAL_VERSION) GV *gv; SV *sv; char *undef; + double req; if(SvROK(ST(0))) { sv = (SV*)SvRV(ST(0)); @@ -222,9 +223,9 @@ XS(XS_UNIVERSAL_VERSION) undef = "(undef)"; } - if(items > 1 && (undef || SvNV(ST(1)) > SvNV(sv))) + if (items > 1 && (undef || (req = SvNV(ST(1)), req > SvNV(sv)))) croak("%s version %s required--this is only version %s", - HvNAME(pkg),SvPV(ST(1),na),undef ? undef : SvPV(sv,na)); + HvNAME(pkg), SvPV(ST(1),na), undef ? undef : SvPV(sv,na)); ST(0) = sv;