summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2015-12-06 01:45:00 +0000
committerIan Jackson <ijackson@chiark.greenend.org.uk>2015-12-06 01:45:00 +0000
commit61c8ce5bb3f245c365ca7381497b43fd40a987b4 (patch)
tree9a1db21f025e095e9fff0547547df75202e37a3e
parent32e76c7d514d05d5ac6ad9833035b9826fbc1c8f (diff)
In signal handler, crash if write() fails in an unexpected way
-rw-r--r--statemc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/statemc.c b/statemc.c
index cb5139d..b068722 100644
--- a/statemc.c
+++ b/statemc.c
@@ -546,7 +546,8 @@ static void sigarrived_handler(int signum) {
default:
abort();
}
- write(signal_self_pipe[1],&x,1);
+ int r = write(signal_self_pipe[1],&x,1);
+ if (!(r==1 || isewouldblock(errno))) abort();
errno = esave;
}