summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2012-02-06 19:18:57 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-02-06 19:18:57 -0800
commitf0533365dc1c89253a551a77fbc987568bb8e650 (patch)
treea56622d8eaacfe3ef2958e410c301c3cbf153a86
parent0c34c14a17af0e90086f674f6a4d510673e250c8 (diff)
parentefa08a6c2190afb6214a4c6a75a14700def5a43e (diff)
downloadframeworks_base-f0533365dc1c89253a551a77fbc987568bb8e650.zip
frameworks_base-f0533365dc1c89253a551a77fbc987568bb8e650.tar.gz
frameworks_base-f0533365dc1c89253a551a77fbc987568bb8e650.tar.bz2
Merge "make sure to ignore SIGPIPE in the write side of BitTube"
-rw-r--r--libs/gui/BitTube.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/libs/gui/BitTube.cpp b/libs/gui/BitTube.cpp
index 785da39..55f4178 100644
--- a/libs/gui/BitTube.cpp
+++ b/libs/gui/BitTube.cpp
@@ -17,8 +17,9 @@
#include <stdint.h>
#include <sys/types.h>
-#include <unistd.h>
#include <fcntl.h>
+#include <signal.h>
+#include <unistd.h>
#include <utils/Errors.h>
@@ -38,6 +39,8 @@ BitTube::BitTube()
mSendFd = fds[1];
fcntl(mReceiveFd, F_SETFL, O_NONBLOCK);
fcntl(mSendFd, F_SETFL, O_NONBLOCK);
+ // ignore SIGPIPE, we handle write errors through EPIPE instead
+ signal(SIGPIPE, SIG_IGN);
} else {
mReceiveFd = -errno;
ALOGE("BitTube: pipe creation failed (%s)", strerror(-mReceiveFd));