summaryrefslogtreecommitdiffstats
path: root/debuggerd/debuggerd.c
diff options
context:
space:
mode:
authorNick Kralevich <nnk@google.com>2013-06-18 17:57:08 -0700
committerNick Kralevich <nnk@google.com>2013-06-18 17:57:08 -0700
commit96bcd488c286ebc131e6caf6132b77c66343e5e2 (patch)
tree1d4ceca461836cf18088da3d22adc8478229468a /debuggerd/debuggerd.c
parentf5d79aa4bb712fa5d8bd1b838317772c63720b3f (diff)
downloadsystem_core-96bcd488c286ebc131e6caf6132b77c66343e5e2.zip
system_core-96bcd488c286ebc131e6caf6132b77c66343e5e2.tar.gz
system_core-96bcd488c286ebc131e6caf6132b77c66343e5e2.tar.bz2
debuggerd: Ignore SIGPIPE
The system server may prematurely close the connection to /data/system/ndebugsocket if it's not interested in the data from debuggerd. If it does so, we don't want to die due to a SIGPIPE. Change-Id: Iaef1f497bcd630144e6df6a06644a3293b85b6e0
Diffstat (limited to 'debuggerd/debuggerd.c')
-rw-r--r--debuggerd/debuggerd.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/debuggerd/debuggerd.c b/debuggerd/debuggerd.c
index da2e9b0..0028bda 100644
--- a/debuggerd/debuggerd.c
+++ b/debuggerd/debuggerd.c
@@ -435,11 +435,13 @@ static int do_server() {
signal(SIGBUS, SIG_DFL);
signal(SIGFPE, SIG_DFL);
signal(SIGSEGV, SIG_DFL);
- signal(SIGPIPE, SIG_DFL);
#ifdef SIGSTKFLT
signal(SIGSTKFLT, SIG_DFL);
#endif
+ // Ignore failed writes to closed sockets
+ signal(SIGPIPE, SIG_IGN);
+
logsocket = socket_local_client("logd",
ANDROID_SOCKET_NAMESPACE_ABSTRACT, SOCK_DGRAM);
if(logsocket < 0) {