summaryrefslogtreecommitdiffstats
path: root/libs/gui
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2012-02-06 19:10:04 -0800
committerMathias Agopian <mathias@google.com>2012-02-06 19:17:56 -0800
commitefa08a6c2190afb6214a4c6a75a14700def5a43e (patch)
tree847c385f32f470c6b8fd33cb76fcd2f4ab40572a /libs/gui
parente75abda25a4a638599b36ba8dc21fe4ddefd61ab (diff)
downloadframeworks_base-efa08a6c2190afb6214a4c6a75a14700def5a43e.zip
frameworks_base-efa08a6c2190afb6214a4c6a75a14700def5a43e.tar.gz
frameworks_base-efa08a6c2190afb6214a4c6a75a14700def5a43e.tar.bz2
make sure to ignore SIGPIPE in the write side of BitTube
Change-Id: If4f037f4403d3ecbcd5f91248354765fc0fa13cb
Diffstat (limited to 'libs/gui')
-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));