summaryrefslogtreecommitdiff
path: root/lib/libcrypto/bio
diff options
context:
space:
mode:
authorBrent Cook <bcook@cvs.openbsd.org>2014-10-13 02:49:54 +0000
committerBrent Cook <bcook@cvs.openbsd.org>2014-10-13 02:49:54 +0000
commit6e36eb585743dc480a39c8e45844237fbb13033e (patch)
treef27daa8ea41f75b614c91a26c3c3d6dd8486e183 /lib/libcrypto/bio
parent14a0e6de88272b088e9c555f9dfebf338cfceade (diff)
The return value on success of fcntl(F_SETFL) is not actually specified,
only that it returns -1 on failure. pointed out by guenther@
Diffstat (limited to 'lib/libcrypto/bio')
-rw-r--r--lib/libcrypto/bio/b_sock.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libcrypto/bio/b_sock.c b/lib/libcrypto/bio/b_sock.c
index 81c48a6e5c6..34e5d9830e2 100644
--- a/lib/libcrypto/bio/b_sock.c
+++ b/lib/libcrypto/bio/b_sock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: b_sock.c,v 1.57 2014/10/13 02:39:09 bcook Exp $ */
+/* $OpenBSD: b_sock.c,v 1.58 2014/10/13 02:49:53 bcook Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -462,8 +462,8 @@ BIO_socket_nbio(int s, int mode)
{
int flags = fcntl(s, F_GETFD);
if (mode && !(flags & O_NONBLOCK))
- return (fcntl(s, F_SETFL, flags | O_NONBLOCK) == 0);
+ return (fcntl(s, F_SETFL, flags | O_NONBLOCK) != -1);
else if (!mode && (flags & O_NONBLOCK))
- return (fcntl(s, F_SETFL, flags & ~O_NONBLOCK) == 0);
+ return (fcntl(s, F_SETFL, flags & ~O_NONBLOCK) != -1);
return (1);
}