diff options
Diffstat (limited to '')
-rw-r--r-- | src/usr.sbin/ocspcheck/http.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/usr.sbin/ocspcheck/http.c b/src/usr.sbin/ocspcheck/http.c index 5c914a4857..e0df6cfa11 100644 --- a/src/usr.sbin/ocspcheck/http.c +++ b/src/usr.sbin/ocspcheck/http.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $Id: http.c,v 1.11 2018/11/29 14:25:07 tedu Exp $ */ | 1 | /* $Id: http.c,v 1.12 2019/06/28 13:32:49 deraadt Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2016 Kristaps Dzonsons <kristaps@bsd.lv> | 3 | * Copyright (c) 2016 Kristaps Dzonsons <kristaps@bsd.lv> |
4 | * | 4 | * |
@@ -72,7 +72,7 @@ dosysread(char *buf, size_t sz, const struct http *http) | |||
72 | ssize_t rc; | 72 | ssize_t rc; |
73 | 73 | ||
74 | rc = read(http->fd, buf, sz); | 74 | rc = read(http->fd, buf, sz); |
75 | if (rc < 0) | 75 | if (rc == -1) |
76 | warn("%s: read", http->src.ip); | 76 | warn("%s: read", http->src.ip); |
77 | return rc; | 77 | return rc; |
78 | } | 78 | } |
@@ -83,7 +83,7 @@ dosyswrite(const void *buf, size_t sz, const struct http *http) | |||
83 | ssize_t rc; | 83 | ssize_t rc; |
84 | 84 | ||
85 | rc = write(http->fd, buf, sz); | 85 | rc = write(http->fd, buf, sz); |
86 | if (rc < 0) | 86 | if (rc == -1) |
87 | warn("%s: write", http->src.ip); | 87 | warn("%s: write", http->src.ip); |
88 | return rc; | 88 | return rc; |
89 | } | 89 | } |
@@ -97,7 +97,7 @@ dotlsread(char *buf, size_t sz, const struct http *http) | |||
97 | rc = tls_read(http->ctx, buf, sz); | 97 | rc = tls_read(http->ctx, buf, sz); |
98 | } while (rc == TLS_WANT_POLLIN || rc == TLS_WANT_POLLOUT); | 98 | } while (rc == TLS_WANT_POLLIN || rc == TLS_WANT_POLLOUT); |
99 | 99 | ||
100 | if (rc < 0) | 100 | if (rc == -1) |
101 | warnx("%s: tls_read: %s", http->src.ip, | 101 | warnx("%s: tls_read: %s", http->src.ip, |
102 | tls_error(http->ctx)); | 102 | tls_error(http->ctx)); |
103 | return rc; | 103 | return rc; |
@@ -112,7 +112,7 @@ dotlswrite(const void *buf, size_t sz, const struct http *http) | |||
112 | rc = tls_write(http->ctx, buf, sz); | 112 | rc = tls_write(http->ctx, buf, sz); |
113 | } while (rc == TLS_WANT_POLLIN || rc == TLS_WANT_POLLOUT); | 113 | } while (rc == TLS_WANT_POLLIN || rc == TLS_WANT_POLLOUT); |
114 | 114 | ||
115 | if (rc < 0) | 115 | if (rc == -1) |
116 | warnx("%s: tls_write: %s", http->src.ip, | 116 | warnx("%s: tls_write: %s", http->src.ip, |
117 | tls_error(http->ctx)); | 117 | tls_error(http->ctx)); |
118 | return rc; | 118 | return rc; |