[ID 20001025.011] [PATCH] t/io/open.t perl@7369[ 7350] breaks VMS perl
[p5sagit/p5-mst-13.2.git] / pp_sys.c
index 9329ffd..28ffcda 100644 (file)
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -57,7 +57,15 @@ extern "C" int syscall(unsigned long,...);
 #if defined(HAS_SOCKET) && !defined(VMS) /* VMS handles sockets via vmsish.h */
 # include <sys/socket.h>
 # if defined(USE_SOCKS) && defined(I_SOCKS)
+#   if !defined(INCLUDE_PROTOTYPES)
+#       define INCLUDE_PROTOTYPES /* for <socks.h> */
+#       define PERL_SOCKS_NEED_PROTOTYPES
+#   endif
 #   include <socks.h>
+#   ifdef PERL_SOCKS_NEED_PROTOTYPES /* keep cpp space clean */
+#       undef INCLUDE_PROTOTYPES
+#       undef PERL_SOCKS_NEED_PROTOTYPES
+#   endif 
 # endif
 # ifdef I_NETDB
 #  include <netdb.h>
@@ -794,9 +802,12 @@ PP(pp_tie)
     POPSTACK;
     if (sv_isobject(sv)) {
        sv_unmagic(varsv, how);
-       /* Croak if a self-tie is attempted */
-       if (varsv == SvRV(sv))
-           Perl_croak(aTHX_ "Self-ties are not supported");
+       /* Croak if a self-tie on an aggregate is attempted. */
+       if (varsv == SvRV(sv) &&
+           (SvTYPE(sv) == SVt_PVAV ||
+            SvTYPE(sv) == SVt_PVHV))
+           Perl_croak(aTHX_
+                      "Self-ties of arrays and hashes are not supported");
        sv_magic(varsv, sv, how, Nullch, 0);
     }
     LEAVE;