summaryrefslogtreecommitdiffstats
path: root/usr.sbin/httpd
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2019-06-28 13:32:41 +0000
committerderaadt <deraadt@openbsd.org>2019-06-28 13:32:41 +0000
commitdf69c215c7c66baf660f3f65414fd34796c96152 (patch)
tree0255639162b24c4a2f761a274e32b69c2256fd45 /usr.sbin/httpd
parentminiroot prototype disklabels should attempt to contain accurate (diff)
downloadwireguard-openbsd-df69c215c7c66baf660f3f65414fd34796c96152.tar.xz
wireguard-openbsd-df69c215c7c66baf660f3f65414fd34796c96152.zip
When system calls indicate an error they return -1, not some arbitrary
value < 0. errno is only updated in this case. Change all (most?) callers of syscalls to follow this better, and let's see if this strictness helps us in the future.
Diffstat (limited to 'usr.sbin/httpd')
-rw-r--r--usr.sbin/httpd/parse.y4
-rw-r--r--usr.sbin/httpd/server.c6
2 files changed, 5 insertions, 5 deletions
diff --git a/usr.sbin/httpd/parse.y b/usr.sbin/httpd/parse.y
index ead70654e87..054302269f4 100644
--- a/usr.sbin/httpd/parse.y
+++ b/usr.sbin/httpd/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.112 2019/05/08 19:57:45 reyk Exp $ */
+/* $OpenBSD: parse.y,v 1.113 2019/06/28 13:32:47 deraadt Exp $ */
/*
* Copyright (c) 2007 - 2015 Reyk Floeter <reyk@openbsd.org>
@@ -2338,7 +2338,7 @@ is_if_in_group(const char *ifname, const char *groupname)
int s;
int ret = 0;
- if ((s = socket(AF_INET, SOCK_DGRAM, 0)) < 0)
+ if ((s = socket(AF_INET, SOCK_DGRAM, 0)) == -1)
err(1, "socket");
memset(&ifgr, 0, sizeof(ifgr));
diff --git a/usr.sbin/httpd/server.c b/usr.sbin/httpd/server.c
index daedde16551..577c9c7150e 100644
--- a/usr.sbin/httpd/server.c
+++ b/usr.sbin/httpd/server.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: server.c,v 1.118 2019/02/19 11:37:26 pirofti Exp $ */
+/* $OpenBSD: server.c,v 1.119 2019/06/28 13:32:47 deraadt Exp $ */
/*
* Copyright (c) 2006 - 2015 Reyk Floeter <reyk@openbsd.org>
@@ -821,7 +821,7 @@ server_tls_readcb(int fd, short event, void *arg)
ret = tls_read(clt->clt_tls_ctx, rbuf, howmuch);
if (ret == TLS_WANT_POLLIN || ret == TLS_WANT_POLLOUT) {
goto retry;
- } else if (ret < 0) {
+ } else if (ret == -1) {
what |= EVBUFFER_ERROR;
goto err;
}
@@ -881,7 +881,7 @@ server_tls_writecb(int fd, short event, void *arg)
EVBUFFER_LENGTH(bufev->output));
if (ret == TLS_WANT_POLLIN || ret == TLS_WANT_POLLOUT) {
goto retry;
- } else if (ret < 0) {
+ } else if (ret == -1) {
what |= EVBUFFER_ERROR;
goto err;
}