summaryrefslogtreecommitdiff
path: root/src/usr.bin/openssl/s_server.c
diff options
context:
space:
mode:
authorderaadt <>2019-06-28 13:35:02 +0000
committerderaadt <>2019-06-28 13:35:02 +0000
commit835d788017c49be8b4986b0f04686da55f2cd0da (patch)
treebc969c069c7b769f2601db17f08bec99274202a5 /src/usr.bin/openssl/s_server.c
parentc1fcaeae79bc31f65b74c1825ddee23b90beee04 (diff)
downloadopenbsd-835d788017c49be8b4986b0f04686da55f2cd0da.tar.gz
openbsd-835d788017c49be8b4986b0f04686da55f2cd0da.tar.bz2
openbsd-835d788017c49be8b4986b0f04686da55f2cd0da.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_server.c')
-rw-r--r--src/usr.bin/openssl/s_server.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/usr.bin/openssl/s_server.c b/src/usr.bin/openssl/s_server.c
index 4bdafaf682..a15795151f 100644
--- a/src/usr.bin/openssl/s_server.c
+++ b/src/usr.bin/openssl/s_server.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: s_server.c,v 1.30 2018/02/07 05:47:55 jsing Exp $ */ 1/* $OpenBSD: s_server.c,v 1.31 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 *
@@ -1512,7 +1512,7 @@ sv_body(char *hostname, int s, unsigned char *context)
1512 n = write(fileno(stdout), buf + len, i - len); 1512 n = write(fileno(stdout), buf + len, i - len);
1513 } while (n == -1 && errno == EINTR); 1513 } while (n == -1 && errno == EINTR);
1514 1514
1515 if (n < 0) { 1515 if (n == -1) {
1516 BIO_printf(bio_s_out, "ERROR\n"); 1516 BIO_printf(bio_s_out, "ERROR\n");
1517 goto err; 1517 goto err;
1518 } 1518 }