Change 14068 by jhi@alpha on 2002/01/04 20:24:59

        If we do have socketpair(), make my_socketpair()
        just call the real socketpair().  This way we always
        have real code behind my_socketpair() and a symbol
        corresponding to the my_socketpair in global.sym.

Affected files ...

.... //depot/perl/embed.fnc#2 edit
.... //depot/perl/embed.h#324 edit
.... //depot/perl/makedef.pl#101 edit
.... //depot/perl/proto.h#366 edit
.... //depot/perl/util.c#315 edit

Differences ...

==== //depot/perl/embed.fnc#2 (text) ====
Index: perl/embed.fnc
--- perl/embed.fnc.~1~  Fri Jan  4 13:30:06 2002
+++ perl/embed.fnc      Fri Jan  4 13:30:06 2002
@@ -1304,10 +1304,7 @@
 Apd    |char*  |sv_pvn_force_flags|SV* sv|STRLEN* lp|I32 flags
 Apd    |char*  |sv_2pv_flags   |SV* sv|STRLEN* lp|I32 flags
 Ap     |char*  |my_atof2       |const char *s|NV* value
-#if !defined(HAS_SOCKETPAIR) && defined(HAS_SOCKET)
 Apn    |int    |my_socketpair  |int family|int type|int protocol|int fd[2]
-#endif
-
 
 #if defined(USE_PERLIO) && !defined(USE_SFIO)
 Ap     |int    |PerlIO_close           |PerlIO *

==== //depot/perl/embed.h#324 (text+w) ====
Index: perl/embed.h
--- perl/embed.h.~1~    Fri Jan  4 13:30:06 2002
+++ perl/embed.h        Fri Jan  4 13:30:06 2002
@@ -1203,9 +1203,7 @@
 #define sv_pvn_force_flags     Perl_sv_pvn_force_flags
 #define sv_2pv_flags           Perl_sv_2pv_flags
 #define my_atof2               Perl_my_atof2
-#if !defined(HAS_SOCKETPAIR) && defined(HAS_SOCKET)
 #define my_socketpair          Perl_my_socketpair
-#endif
 #if defined(USE_PERLIO) && !defined(USE_SFIO)
 #define PerlIO_close           Perl_PerlIO_close
 #define PerlIO_fill            Perl_PerlIO_fill
@@ -2744,9 +2742,7 @@
 #define sv_pvn_force_flags(a,b,c)      Perl_sv_pvn_force_flags(aTHX_ a,b,c)
 #define sv_2pv_flags(a,b,c)    Perl_sv_2pv_flags(aTHX_ a,b,c)
 #define my_atof2(a,b)          Perl_my_atof2(aTHX_ a,b)
-#if !defined(HAS_SOCKETPAIR) && defined(HAS_SOCKET)
 #define my_socketpair          Perl_my_socketpair
-#endif
 #if defined(USE_PERLIO) && !defined(USE_SFIO)
 #define PerlIO_close(a)                Perl_PerlIO_close(aTHX_ a)
 #define PerlIO_fill(a)         Perl_PerlIO_fill(aTHX_ a)

==== //depot/perl/makedef.pl#101 (text) ====
==== //depot/perl/proto.h#366 (text+w) ====
Index: perl/proto.h
--- perl/proto.h.~1~    Fri Jan  4 13:30:06 2002
+++ perl/proto.h        Fri Jan  4 13:30:06 2002
@@ -5,7 +5,6 @@
  */
 
 
-
 START_EXTERN_C
 
 #if defined(PERL_IMPLICIT_SYS)
@@ -1331,10 +1330,7 @@
 PERL_CALLCONV char*    Perl_sv_pvn_force_flags(pTHX_ SV* sv, STRLEN* lp, I32 flags);
 PERL_CALLCONV char*    Perl_sv_2pv_flags(pTHX_ SV* sv, STRLEN* lp, I32 flags);
 PERL_CALLCONV char*    Perl_my_atof2(pTHX_ const char *s, NV* value);
-#if !defined(HAS_SOCKETPAIR) && defined(HAS_SOCKET)
 PERL_CALLCONV int      Perl_my_socketpair(int family, int type, int protocol, int 
fd[2]);
-#endif
-
 
 #if defined(USE_PERLIO) && !defined(USE_SFIO)
 PERL_CALLCONV int      Perl_PerlIO_close(pTHX_ PerlIO *);

==== //depot/perl/util.c#315 (text) ====
Index: perl/util.c
--- perl/util.c.~1~     Fri Jan  4 13:30:06 2002
+++ perl/util.c Fri Jan  4 13:30:06 2002
@@ -4235,3 +4235,12 @@
     }
 }
 #endif /* !defined(HAS_SOCKETPAIR) && defined(HAS_SOCKET) */
+#ifdef HAS_SOCKETPAIR
+/* In any case have a stub so that there's code corresponding
+ * to the my_socketpair in global.sym. */
+int
+Perl_my_socketpair (int family, int type, int protocol, int fd[2]) {
+    return socketpair(family, type, protocol, fd);
+}
+#endif
+
End of Patch.

Reply via email to