make sure to ignore SIGPIPE in the write side of BitTube

Change-Id: If4f037f4403d3ecbcd5f91248354765fc0fa13cb
This commit is contained in:
Mathias Agopian 2012-02-06 19:10:04 -08:00
parent 59015b369d
commit 99fe3c6d3d
1 changed files with 4 additions and 1 deletions

View File

@ -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));