You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by hi...@apache.org on 2009/05/29 17:48:37 UTC
svn commit: r780017 -
/harmony/enhanced/drlvm/trunk/vm/port/src/signals/linux/signals_common.cpp
Author: hindessm
Date: Fri May 29 15:48:37 2009
New Revision: 780017
URL: http://svn.apache.org/viewvc?rev=780017&view=rev
Log:
Applied patch for "[#HARMONY-6132] [drlvm][build] SSLSocketImplTest breaks
in Fedora since hy.no.sig removal".
Modified:
harmony/enhanced/drlvm/trunk/vm/port/src/signals/linux/signals_common.cpp
Modified: harmony/enhanced/drlvm/trunk/vm/port/src/signals/linux/signals_common.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/port/src/signals/linux/signals_common.cpp?rev=780017&r1=780016&r2=780017&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/port/src/signals/linux/signals_common.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/port/src/signals/linux/signals_common.cpp Fri May 29 15:48:37 2009
@@ -265,6 +265,21 @@
static struct sigaction old_actions[sizeof(signals_used)/sizeof(signals_used[0])];
+// For signals that must change their default behavior
+struct sig_redef
+{
+ int signal;
+ sighandler_t handler;
+ bool set_up;
+};
+
+static sig_redef signals_other[] =
+{
+ { SIGPIPE, SIG_IGN, false }
+};
+
+static sighandler_t old_handlers[sizeof(signals_other)/sizeof(signals_other[0])];
+
static void restore_signals()
{
@@ -276,6 +291,14 @@
signals_used[i].set_up = false;
sigaction(signals_used[i].signal, &old_actions[i], NULL);
}
+ for (size_t j = 0; j < sizeof(signals_other)/sizeof(signals_other[0]); j++)
+ {
+ if (!signals_other[j].set_up)
+ continue;
+
+ signals_other[j].set_up = false;
+ signal(signals_other[j].signal, old_handlers[j]);
+ }
}
int initialize_signals()
@@ -301,6 +324,17 @@
signals_used[i].set_up = true;
}
+ for (size_t j = 0; j < sizeof(signals_other)/sizeof(signals_other[0]); j++)
+ {
+ old_handlers[j] = signal(signals_other[j].signal, signals_other[j].handler);
+ if (old_handlers[j] == SIG_ERR)
+ {
+ restore_signals();
+ return -1;
+ }
+ signals_other[j].set_up = true;
+ }
+
// Prepare gdb crash handler
if (!init_gdb_crash_handler())
{