diff options
author | bcook <> | 2019-05-15 13:44:18 +0000 |
---|---|---|
committer | bcook <> | 2019-05-15 13:44:18 +0000 |
commit | d931777c06c73b2586632c603beec2156c9c73b2 (patch) | |
tree | 1f6069b2872a9e61285f54fb269ae80209ba5185 | |
parent | 3c8e40888023ea3a64023ce924efeff05ee35993 (diff) | |
download | openbsd-d931777c06c73b2586632c603beec2156c9c73b2.tar.gz openbsd-d931777c06c73b2586632c603beec2156c9c73b2.tar.bz2 openbsd-d931777c06c73b2586632c603beec2156c9c73b2.zip |
check result of ftruncate() as we do write() below
ok beck@
-rw-r--r-- | src/usr.sbin/ocspcheck/ocspcheck.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/usr.sbin/ocspcheck/ocspcheck.c b/src/usr.sbin/ocspcheck/ocspcheck.c index 551a8fa091..41700f91a0 100644 --- a/src/usr.sbin/ocspcheck/ocspcheck.c +++ b/src/usr.sbin/ocspcheck/ocspcheck.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ocspcheck.c,v 1.24 2017/12/01 14:42:23 visa Exp $ */ | 1 | /* $OpenBSD: ocspcheck.c,v 1.25 2019/05/15 13:44:18 bcook Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Copyright (c) 2017 Bob Beck <beck@openbsd.org> | 4 | * Copyright (c) 2017 Bob Beck <beck@openbsd.org> |
@@ -670,7 +670,9 @@ main(int argc, char **argv) | |||
670 | * write out the DER format response to the staplefd | 670 | * write out the DER format response to the staplefd |
671 | */ | 671 | */ |
672 | if (staplefd >= 0) { | 672 | if (staplefd >= 0) { |
673 | (void) ftruncate(staplefd, 0); | 673 | while (ftruncate(staplefd, 0) < 0) |
674 | if (errno != EINTR && errno != EAGAIN) | ||
675 | err(1, "Write of OCSP response failed"); | ||
674 | w = 0; | 676 | w = 0; |
675 | written = 0; | 677 | written = 0; |
676 | while (written < instaplesz) { | 678 | while (written < instaplesz) { |