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