X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pp_sys.c;h=e2c4111bdeb2e2c727b1aadf1e676fc7102d3d57;hb=6ec152c37130b7e4730fc56d5699a4b02f7c0f4a;hp=d6266dc38ce457154067842ad1ab0afe84993da7;hpb=571714202f6d2012220ed718d95c0404dd890ea5;p=p5sagit%2Fp5-mst-13.2.git diff --git a/pp_sys.c b/pp_sys.c index d6266dc..e2c4111 100644 --- a/pp_sys.c +++ b/pp_sys.c @@ -98,12 +98,6 @@ extern int h_errno; # endif #endif -#ifdef I_SYS_UN -# ifdef __linux__ -# include -# endif -#endif - /* Put this after #includes because fork and vfork prototypes may conflict. */ #ifndef HAS_VFORK # define vfork fork @@ -1567,6 +1561,10 @@ PP(pp_sysread) (struct sockaddr *)namebuf, &bufsize); if (count < 0) RETPUSHUNDEF; +#ifdef EPOC + /* Bogus return without padding */ + bufsize = sizeof (struct sockaddr_in); +#endif SvCUR_set(bufsv, count); *SvEND(bufsv) = '\0'; (void)SvPOK_only(bufsv); @@ -1577,13 +1575,6 @@ PP(pp_sysread) if (!(IoFLAGS(io) & IOf_UNTAINT)) SvTAINTED_on(bufsv); SP = ORIGMARK; -#if defined(I_SYS_UN) && defined(__linux__) - /* Linux returns the sum of actual pathname string length and the - size of the other members of sockaddr_un members. It should - return sizeof(struct sockaddr_un). */ - if (((struct sockaddr *)namebuf)->sa_family == AF_UNIX) - bufsize = sizeof(struct sockaddr_un); -#endif sv_setpvn(TARG, namebuf, bufsize); PUSHs(TARG); RETURN; @@ -2266,8 +2257,10 @@ PP(pp_sockpair) RETPUSHUNDEF; } - if (IoIFP(io)) - do_close(gv, FALSE); + if (IoIFP(io1)) + do_close(gv1, FALSE); + if (IoIFP(io2)) + do_close(gv2, FALSE); TAINT_PROPER("socketpair"); if (PerlSock_socketpair(domain, type, protocol, fd) < 0) @@ -2462,12 +2455,6 @@ PP(pp_accept) setbuf( IoIFP(nstio), NULL); /* EPOC gets confused about sockets */ #endif -#if defined(I_SYS_UN) && defined(__linux__) - /* see the comment in pp_sysread */ - if (saddr.sa_family == AF_UNIX) - len = sizeof(struct sockaddr_un); -#endif - PUSHp((char *)&saddr, len); RETURN; @@ -2645,11 +2632,6 @@ PP(pp_getpeername) if (len == BOGUS_GETNAME_RETURN) len = sizeof(struct sockaddr); #endif -#if defined(I_SYS_UN) && defined(__linux__) - /* see the comment in pp_sysread */ - if (((struct sockaddr *)SvPVX(sv))->sa_family == AF_UNIX) - len = sizeof(struct sockaddr_un); -#endif SvCUR_set(sv, len); *SvEND(sv) ='\0'; PUSHs(sv);