summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbeck <beck@openbsd.org>2015-09-10 13:49:48 +0000
committerbeck <beck@openbsd.org>2015-09-10 13:49:48 +0000
commitcd548fa4c7b6f70405f9604a9f030cf13e1f24b7 (patch)
treed32c964a38ec4a515976d876bdf63e441e7b0054
parentmissing commas at the end of .Nm lines in the NAME section (diff)
downloadwireguard-openbsd-cd548fa4c7b6f70405f9604a9f030cf13e1f24b7.tar.xz
wireguard-openbsd-cd548fa4c7b6f70405f9604a9f030cf13e1f24b7.zip
fix type and return check for tls_read/write.
jontly with jsing@
-rw-r--r--usr.sbin/ntpd/constraint.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.sbin/ntpd/constraint.c b/usr.sbin/ntpd/constraint.c
index b313a308a39..cf924416cdd 100644
--- a/usr.sbin/ntpd/constraint.c
+++ b/usr.sbin/ntpd/constraint.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: constraint.c,v 1.16 2015/09/10 10:34:19 beck Exp $ */
+/* $OpenBSD: constraint.c,v 1.17 2015/09/10 13:49:48 beck Exp $ */
/*
* Copyright (c) 2015 Reyk Floeter <reyk@openbsd.org>
@@ -643,7 +643,7 @@ httpsdate_request(struct httpsdate *httpsdate, struct timeval *when)
{
size_t outlen = 0, maxlength = CONSTRAINT_MAXHEADERLENGTH, len;
char *line, *p, *buf;
- int ret;
+ ssize_t ret;
if ((httpsdate->tls_ctx = tls_client()) == NULL)
goto fail;
@@ -744,7 +744,7 @@ tls_readline(struct tls *tls, size_t *lenp, size_t *maxlength,
{
size_t i, len;
char *buf, *q, c;
- int ret;
+ ssize_t ret;
len = 128;
if ((buf = malloc(len)) == NULL)
@@ -760,7 +760,7 @@ tls_readline(struct tls *tls, size_t *lenp, size_t *maxlength,
ret = tls_read(tls, &c, 1);
if (ret == TLS_WANT_POLLIN || ret == TLS_WANT_POLLOUT)
goto again;
- if (ret != 0) {
+ if (ret < 0) {
/* SSL read error, ignore */
free(buf);
return (NULL);