develooper Front page | perl.perl5.porters | Postings from November 2003

Re: $^E bug and perl 5.8.0

Thread Previous | Thread Next
From:
Rafael Garcia-Suarez
Date:
November 19, 2003 07:52
Subject:
Re: $^E bug and perl 5.8.0
Message ID:
20031119165017.24af8dfd.rgarciasuarez@free.fr
Chris Nandor wrote:
>
> At 16:39 +0100 2003.11.19, Rafael Garcia-Suarez wrote:
> >What does
> >	perl -le 'print $!=22'
> >on your system ?
> 
> 22.

Hmm, weird -- on my Linux 2.2 it prints correctly "Invalid argument".
I wanted to know what was this errno corresponding to.
(but I can't reproduce your bug either)

Try this naive patch :

--- mg.c.orig	Wed Nov 19 16:41:47 2003
+++ mg.c	Wed Nov 19 16:44:14 2003
@@ -623,8 +623,12 @@ Perl_magic_get(pTHX_ SV *sv, MAGIC *mg)
 		  SetLastError(dwErr);
 	     }
 #else
-	     sv_setnv(sv, (NV)errno);
-	     sv_setpv(sv, errno ? Strerror(errno) : "");
+	     {
+		 int saveerrno = errno;
+		 sv_setnv(sv, (NV)errno);
+		 sv_setpv(sv, errno ? Strerror(errno) : "");
+		 errno = saveerrno;
+	     }
 #endif
 #endif
 #endif

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About