From d463e0109543c20269d69b691db59349ef8f05aa Mon Sep 17 00:00:00 2001 From: sin Date: Fri, 7 Feb 2014 16:50:01 +0000 Subject: Don't process incomplete reads If that can ever happen... --- sinit.c | 2 ++ 1 file changed, 2 insertions(+) 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(); -- cgit v1.2.3-70-g09d2