From 6585927e66d9ab172754d95c4296dd4309a40512 Mon Sep 17 00:00:00 2001 From: deraadt <> Date: Fri, 28 Jun 2019 13:35:02 +0000 Subject: 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. --- src/usr.bin/openssl/s_client.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/usr.bin/openssl/s_client.c') diff --git a/src/usr.bin/openssl/s_client.c b/src/usr.bin/openssl/s_client.c index e542f08481..23bf67e695 100644 --- a/src/usr.bin/openssl/s_client.c +++ b/src/usr.bin/openssl/s_client.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s_client.c,v 1.37 2018/11/14 06:24:21 tb Exp $ */ +/* $OpenBSD: s_client.c,v 1.38 2019/06/28 13:35:02 deraadt Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -759,7 +759,7 @@ re_start: if (SSL_version(con) == DTLS1_VERSION) { sbio = BIO_new_dgram(s, BIO_NOCLOSE); - if (getsockname(s, &peer, (void *) &peerlen) < 0) { + if (getsockname(s, &peer, (void *) &peerlen) == -1) { BIO_printf(bio_err, "getsockname:errno=%d\n", errno); shutdown(s, SHUT_RD); @@ -1013,7 +1013,7 @@ re_start: tty_on,read_tty,write_tty,read_ssl,write_ssl);*/ i = poll(pfd, 3, ptimeout); - if (i < 0) { + if (i == -1) { BIO_printf(bio_err, "bad select %d\n", errno); goto shut; -- cgit v1.2.3-55-g6feb