Mailinglist Archive: yast-commit (759 mails)

< Previous Next >
[yast-commit] r45892 - in /trunk/perl-bindings: VERSION package/yast2-perl-bindings.changes src/YPerl.cc
  • From: mvidner@xxxxxxxxxxxxxxxx
  • Date: Mon, 31 Mar 2008 14:36:47 -0000
  • Message-id: <20080331143647.CFAE62FB2A@xxxxxxxxxxxxxxxx>
Author: mvidner
Date: Mon Mar 31 16:36:47 2008
New Revision: 45892

URL: http://svn.opensuse.org/viewcvs/yast?rev=45892&view=rev
Log:
Trap Perl exceptions so that simple bugs don't kill the whole YaST
(FATE 412).

Modified:
trunk/perl-bindings/VERSION
trunk/perl-bindings/package/yast2-perl-bindings.changes
trunk/perl-bindings/src/YPerl.cc

Modified: trunk/perl-bindings/VERSION
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/perl-bindings/VERSION?rev=45892&r1=45891&r2=45892&view=diff
==============================================================================
--- trunk/perl-bindings/VERSION (original)
+++ trunk/perl-bindings/VERSION Mon Mar 31 16:36:47 2008
@@ -1 +1 @@
-2.16.4
+2.16.5

Modified: trunk/perl-bindings/package/yast2-perl-bindings.changes
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/perl-bindings/package/yast2-perl-bindings.changes?rev=45892&r1=45891&r2=45892&view=diff
==============================================================================
--- trunk/perl-bindings/package/yast2-perl-bindings.changes (original)
+++ trunk/perl-bindings/package/yast2-perl-bindings.changes Mon Mar 31 16:36:47
2008
@@ -1,4 +1,11 @@
-------------------------------------------------------------------
+Mon Mar 31 16:36:21 CEST 2008 - mvidner@xxxxxxx
+
+- Trap Perl exceptions so that simple bugs don't kill the whole YaST
+ (FATE 412).
+- 2.16.5
+
+-------------------------------------------------------------------
Wed Mar 12 14:46:56 CET 2008 - mvidner@xxxxxxx

- adapt testsuite results to latest debug output again

Modified: trunk/perl-bindings/src/YPerl.cc
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/perl-bindings/src/YPerl.cc?rev=45892&r1=45891&r2=45892&view=diff
==============================================================================
--- trunk/perl-bindings/src/YPerl.cc (original)
+++ trunk/perl-bindings/src/YPerl.cc Mon Mar 31 16:36:47 2008
@@ -285,8 +285,10 @@
string full_name = module + "::" + function;
int ret_count = 0;

+ // G_EVAL: prevent errors from making Perl (and the rest of YaST) die
+ // (FATE 412)
// so far we use static methods, so call_pv is enough
- ret_count = call_pv( full_name.c_str(), calling_context );
+ ret_count = call_pv( full_name.c_str(), calling_context | G_EVAL);


//
@@ -295,6 +297,13 @@

SPAGAIN; // Copy global stack pointer to local one

+ // if the eval catches an exception, undef is returned
+ // and we check $@ (ERRSV)
+ if (SvTRUE(ERRSV))
+ {
+ ycp2error ("Perl wanted to die: %s", SvPV_nolen(ERRSV));
+ }
+
YCPValue result = fromPerlScalar (POPs, wanted_result_type);

// If we called it with G_ARRAY, we would have to pop all return

--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages