aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsin <sin@2f30.org>2014-02-07 16:50:01 +0000
committersin <sin@2f30.org>2014-02-07 16:50:01 +0000
commitd463e0109543c20269d69b691db59349ef8f05aa (patch)
tree5fb88999156016145c5da5bae9dab860a3b3f015
parent9ad5329913cf99e5498ddff228d5906f9570e28b (diff)
Don't process incomplete reads
If that can ever happen...
-rw-r--r--sinit.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sinit.c b/sinit.c
index ce93b19..c881fe0 100644
--- a/sinit.c
+++ b/sinit.c
@@ -79,6 +79,8 @@ main(void)
n = read(sigfd, &siginfo, sizeof(siginfo));
if (n < 0)
eprintf("sinit: read:");
+ if (n != sizeof(siginfo))
+ continue;
for (i = 0; i < LEN(dispatchsig); i++)
if (dispatchsig[i].sig == siginfo.ssi_signo)
dispatchsig[i].func();