This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
use a fresh stack when loading Errno.pm etc.
[perl5.git] / reentr.pl
index c8a5606..049b06e 100644 (file)
--- a/reentr.pl
+++ b/reentr.pl
@@ -49,7 +49,7 @@ print <<EOF;
  *
  *    reentr.h
  *
- *    Copyright (C) 2002, 2003, 2005, 2006 by Larry Wall and others
+ *    Copyright (C) 2002, 2003, 2005, 2006, 2007 by Larry Wall and others
  *
  *    You may distribute under the terms of either the GNU General Public
  *    License or the Artistic License, as specified in the README file.
@@ -110,9 +110,9 @@ print <<EOF;
  * memzero out certain structures before calling the functions.
  */
 #if defined(__OpenBSD__)
-#    define REENTR_MEMZERO(a,b) memzero(a,b),
+#    define REENTR_MEMZERO(a,b) memzero(a,b)
 #else
-#    define REENTR_MEMZERO(a,b)
+#    define REENTR_MEMZERO(a,b) 0
 #endif 
 
 #ifdef NETDB_R_OBSOLETE
@@ -717,12 +717,15 @@ EOF
            }
 
            my $call = "${func}_r($v$w)";
+           if ($func eq 'localtime') {
+               $call = "L_R_TZSET $call";
+           }
 
             # Must make OpenBSD happy
             my $memzero = '';
             if($p =~ /D$/ &&
                 ($genfunc eq 'protoent' || $genfunc eq 'servent')) {
-                $memzero = 'REENTR_MEMZERO(&PL_reentrant_buffer->_' . $genfunc . '_data, sizeof(PL_reentrant_buffer->_' . $genfunc . '_data))';
+                $memzero = 'REENTR_MEMZERO(&PL_reentrant_buffer->_' . $genfunc . '_data, sizeof(PL_reentrant_buffer->_' . $genfunc . '_data)),';
             }
            push @wrap, <<EOF;
 #   if !defined($func) && ${FUNC}_R_PROTO == REENTRANT_PROTO_$p
@@ -798,7 +801,7 @@ print <<EOF;
  *
  *    reentr.c
  *
- *    Copyright (C) 2002, 2003, 2005, 2006 by Larry Wall and others
+ *    Copyright (C) 2002, 2003, 2005, 2006, 2007 by Larry Wall and others
  *
  *    You may distribute under the terms of either the GNU General Public
  *    License or the Artistic License, as specified in the README file.