diff options
| author | 2012-02-06 19:18:57 -0800 | |
|---|---|---|
| committer | 2012-02-06 19:18:57 -0800 | |
| commit | 619258483fb45474dbeb4eb18c110e5a2a386f41 (patch) | |
| tree | 02b72dbca16644978308e2eb2b86f79b8ebc08df /libs/gui/BitTube.cpp | |
| parent | 492b8611a449bbf32143189f6fbf4f8461c7ee87 (diff) | |
| parent | 99fe3c6d3dcb6fb26bf283343f946d031b052dff (diff) | |
Merge "make sure to ignore SIGPIPE in the write side of BitTube"
Diffstat (limited to 'libs/gui/BitTube.cpp')
| -rw-r--r-- | libs/gui/BitTube.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libs/gui/BitTube.cpp b/libs/gui/BitTube.cpp index 785da39b95..55f4178421 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)); |