[perl/f18] Clear $@ before `do' I/O error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



commit 8b4dd9728b954d7534ed3bf4005c164241e5458c
Author: Petr Písař <ppisar@xxxxxxxxxx>
Date:   Tue Sep 11 10:32:13 2012 +0200

    Clear $@ before `do' I/O error

 ...T-113730-should-be-cleared-on-do-IO-error.patch |   46 ++++++++++++++++++++
 perl.spec                                          |    5 ++
 2 files changed, 51 insertions(+), 0 deletions(-)
---
diff --git a/perl-5.16.1-RT-113730-should-be-cleared-on-do-IO-error.patch b/perl-5.16.1-RT-113730-should-be-cleared-on-do-IO-error.patch
new file mode 100644
index 0000000..e08fde7
--- /dev/null
+++ b/perl-5.16.1-RT-113730-should-be-cleared-on-do-IO-error.patch
@@ -0,0 +1,46 @@
+From a3ff80c12c16886edf9acdd3d172798e50defdb3 Mon Sep 17 00:00:00 2001
+From: Eric Brine <ikegami@xxxxxxxxxxx>
+Date: Mon, 18 Jun 2012 14:56:32 -0400
+Subject: [PATCH] RT#113730 - $@ should be cleared on "do" IO error.
+
+---
+ pp_ctl.c  |  1 +
+ t/op/do.t | 12 ++++++++++++
+ 2 files changed, 13 insertions(+)
+
+diff --git a/pp_ctl.c b/pp_ctl.c
+index b414e81..437bc8f 100644
+--- a/pp_ctl.c
++++ b/pp_ctl.c
+@@ -3928,6 +3928,7 @@ PP(pp_require)
+ 	    DIE(aTHX_ "Can't locate %s", name);
+ 	}
+ 
++	CLEAR_ERRSV();
+ 	RETPUSHUNDEF;
+     }
+     else
+diff --git a/t/op/do.t b/t/op/do.t
+index 93d3f73..c5a5905 100644
+--- a/t/op/do.t
++++ b/t/op/do.t
+@@ -286,4 +286,16 @@ SKIP: {
+   is($w, undef, 'do STRING does not propagate warning hints');
+ }
+ 
++# RT#113730 - $@ should be cleared on IO error.
++{
++    $@ = "should not see";
++    $! = 0;
++    my $rv = do("some nonexistent file");
++    my $saved_error = $@;
++    my $saved_errno = $!;
++    ok(!$rv,          "do returns false on io errror");
++    ok(!$saved_error, "\$\@ not set on io error");
++    ok($saved_errno,  "\$! set on io error");
++}
++
+ done_testing();
+-- 
+1.7.11.4
+
diff --git a/perl.spec b/perl.spec
index 396cb46..d5fd5fa 100644
--- a/perl.spec
+++ b/perl.spec
@@ -90,6 +90,8 @@ Patch12:        perl-5.16.1-PATCH-perl-114220-h-not-equiv-to-h.patch
 # TODO Looks like it was fixed differently?
 #Patch13:        perl-5.14.2-locale-search-inc.patch
 
+# Clear $@ before `do' I/O error, rhbz#834226, RT#113730
+Patch13:        perl-5.16.1-RT-113730-should-be-cleared-on-do-IO-error.patch
 
 
 # Update some of the bundled modules
@@ -1310,6 +1312,7 @@ tarball from perl.org.
 %patch10 -p1
 %patch11 -p1
 %patch12 -p1
+%patch13 -p1
 
 #copy the example script
 cp -a %{SOURCE5} .
@@ -1514,6 +1517,7 @@ pushd %{build_archlib}/CORE/
     'Fedora Patch10: Fix broken atof (RT#109318)' \
     'Fedora Patch11: Do not access freed memory when cloning thread (RT#111610)' \
     'Fedora Patch12: Match non-breakable space with /[\h]/ in ASCII mode (RT#114220)' \
+    'Fedora Patch13: Clear $@ before "do" I/O error (RT#113730)' \
     %{nil}
 
 rm patchlevel.bak
@@ -2586,6 +2590,7 @@ sed \
 * Tue Sep 11 2012 Petr Pisar <ppisar@xxxxxxxxxx> - 4:5.16.1-230
 - Do not access freed memory when cloning thread (bug #825749)
 - Match non-breakable space with /[\h]/ in ASCII mode (bug #844919)
+- Clear $@ before `do' I/O error (bug #834226)
 
 * Wed Sep 05 2012 Petr Pisar <ppisar@xxxxxxxxxx> - 4:5.16.1-229
 - Remove perl-devel dependency from perl-Test-Harness and perl-Test-Simple
--
Fedora Extras Perl SIG
http://www.fedoraproject.org/wiki/Extras/SIGs/Perl
perl-devel mailing list
perl-devel@xxxxxxxxxxxxxxxxxxxxxxx
https://admin.fedoraproject.org/mailman/listinfo/perl-devel



[Index of Archives]     [Fedora Announce]     [Fedora Kernel]     [Fedora Testing]     [Fedora Legacy Announce]     [Fedora PHP Devel]     [Kernel Devel]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Big List of Linux Books]     [Gimp]     [Yosemite Information]
  Powered by Linux