summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Labath <labath@google.com>2016-07-04 13:07:35 +0000
committerPavel Labath <labath@google.com>2016-07-04 13:07:35 +0000
commit140b8d1ecdd3c851322b4d4ded6ac443cb109825 (patch)
tree00528d017c4c4e8d3ae9347f2cb40bb0c7041948
parent9fca300cbeaf7a1a9a734000183a39c6365c08b3 (diff)
downloadbcm5719-llvm-140b8d1ecdd3c851322b4d4ded6ac443cb109825.tar.gz
bcm5719-llvm-140b8d1ecdd3c851322b4d4ded6ac443cb109825.zip
Remove SIGPIPE handler in LLGS
It is sufficient to set the handeler to SIG_IGN, to get the desired behaviour. Also, the handler calling a lot of signal-unsafe functions. llvm-svn: 274499
-rw-r--r--lldb/tools/lldb-server/lldb-gdbserver.cpp21
1 files changed, 1 insertions, 20 deletions
diff --git a/lldb/tools/lldb-server/lldb-gdbserver.cpp b/lldb/tools/lldb-server/lldb-gdbserver.cpp
index b887cf94a40..b8c59e29eb5 100644
--- a/lldb/tools/lldb-server/lldb-gdbserver.cpp
+++ b/lldb/tools/lldb-server/lldb-gdbserver.cpp
@@ -77,28 +77,9 @@ static struct option g_long_options[] =
//----------------------------------------------------------------------
// Watch for signals
//----------------------------------------------------------------------
-static int g_sigpipe_received = 0;
static int g_sighup_received_count = 0;
#ifndef _WIN32
-
-static void
-signal_handler(int signo)
-{
- Log *log (GetLogIfAnyCategoriesSet(LIBLLDB_LOG_PROCESS));
-
- fprintf (stderr, "lldb-server:%s received signal %d\n", __FUNCTION__, signo);
- if (log)
- log->Printf ("lldb-server:%s received signal %d", __FUNCTION__, signo);
-
- switch (signo)
- {
- case SIGPIPE:
- g_sigpipe_received = 1;
- break;
- }
-}
-
static void
sighup_handler(MainLoopBase &mainloop)
{
@@ -348,7 +329,7 @@ main_gdbserver (int argc, char *argv[])
MainLoop mainloop;
#ifndef _WIN32
// Setup signal handlers first thing.
- signal (SIGPIPE, signal_handler);
+ signal(SIGPIPE, SIG_IGN);
MainLoop::SignalHandleUP sighup_handle = mainloop.RegisterSignal(SIGHUP, sighup_handler, error);
#endif
OpenPOWER on IntegriCloud