summaryrefslogtreecommitdiff
path: root/src/usr.bin/openssl/s_client.c
diff options
context:
space:
mode:
authorderaadt <>2019-06-28 13:35:02 +0000
committerderaadt <>2019-06-28 13:35:02 +0000
commit6585927e66d9ab172754d95c4296dd4309a40512 (patch)
treebc969c069c7b769f2601db17f08bec99274202a5 /src/usr.bin/openssl/s_client.c
parent74ff76124ba7a371400a9f60d5e33192a3732f03 (diff)
downloadopenbsd-6585927e66d9ab172754d95c4296dd4309a40512.tar.gz
openbsd-6585927e66d9ab172754d95c4296dd4309a40512.tar.bz2
openbsd-6585927e66d9ab172754d95c4296dd4309a40512.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 'src/usr.bin/openssl/s_client.c')
-rw-r--r--src/usr.bin/openssl/s_client.c6
1 files changed, 3 insertions, 3 deletions
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 @@
1/* $OpenBSD: s_client.c,v 1.37 2018/11/14 06:24:21 tb Exp $ */ 1/* $OpenBSD: s_client.c,v 1.38 2019/06/28 13:35:02 deraadt Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -759,7 +759,7 @@ re_start:
759 if (SSL_version(con) == DTLS1_VERSION) { 759 if (SSL_version(con) == DTLS1_VERSION) {
760 760
761 sbio = BIO_new_dgram(s, BIO_NOCLOSE); 761 sbio = BIO_new_dgram(s, BIO_NOCLOSE);
762 if (getsockname(s, &peer, (void *) &peerlen) < 0) { 762 if (getsockname(s, &peer, (void *) &peerlen) == -1) {
763 BIO_printf(bio_err, "getsockname:errno=%d\n", 763 BIO_printf(bio_err, "getsockname:errno=%d\n",
764 errno); 764 errno);
765 shutdown(s, SHUT_RD); 765 shutdown(s, SHUT_RD);
@@ -1013,7 +1013,7 @@ re_start:
1013 tty_on,read_tty,write_tty,read_ssl,write_ssl);*/ 1013 tty_on,read_tty,write_tty,read_ssl,write_ssl);*/
1014 1014
1015 i = poll(pfd, 3, ptimeout); 1015 i = poll(pfd, 3, ptimeout);
1016 if (i < 0) { 1016 if (i == -1) {
1017 BIO_printf(bio_err, "bad select %d\n", 1017 BIO_printf(bio_err, "bad select %d\n",
1018 errno); 1018 errno);
1019 goto shut; 1019 goto shut;