diff options
author | sin <sin@2f30.org> | 2014-02-07 16:50:01 +0000 |
---|---|---|
committer | sin <sin@2f30.org> | 2014-02-07 16:50:01 +0000 |
commit | d463e0109543c20269d69b691db59349ef8f05aa (patch) | |
tree | 5fb88999156016145c5da5bae9dab860a3b3f015 | |
parent | 9ad5329913cf99e5498ddff228d5906f9570e28b (diff) |
Don't process incomplete reads
If that can ever happen...
-rw-r--r-- | sinit.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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(); |