summaryrefslogtreecommitdiff
path: root/lib/libc/sys
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2019-06-20 14:19:26 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2019-06-20 14:19:26 +0000
commite57a3e8ce63a2bc8541a3d15947ae77e298072af (patch)
tree0f09d21a503ef46871ca8ce2f113a4e765db496b /lib/libc/sys
parentfb715cb1c500de9f9031aba1880d40fbd41bf65e (diff)
sockatmark(3), recv(2), getsockopt(2), and connect(2) return specifically
-1 to mark failure, not arbitrary values < 0. I believe manual pages should follow the described contract precisely and accurately.
Diffstat (limited to 'lib/libc/sys')
-rw-r--r--lib/libc/sys/connect.28
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/libc/sys/connect.2 b/lib/libc/sys/connect.2
index 746d807fd81..149c9a93eff 100644
--- a/lib/libc/sys/connect.2
+++ b/lib/libc/sys/connect.2
@@ -1,4 +1,4 @@
-.\" $OpenBSD: connect.2,v 1.33 2017/10/05 12:30:16 bluhm Exp $
+.\" $OpenBSD: connect.2,v 1.34 2019/06/20 14:19:25 deraadt Exp $
.\" $NetBSD: connect.2,v 1.8 1995/10/12 15:40:48 jtc Exp $
.\"
.\" Copyright (c) 1983, 1993
@@ -30,7 +30,7 @@
.\"
.\" @(#)connect.2 8.1 (Berkeley) 6/4/93
.\"
-.Dd $Mdocdate: October 5 2017 $
+.Dd $Mdocdate: June 20 2019 $
.Dt CONNECT 2
.Os
.Sh NAME
@@ -128,7 +128,7 @@ connect_wait(int s)
if (poll(pfd, 1, -1) == -1)
return -1;
- if (getsockopt(s, SOL_SOCKET, SO_ERROR, &error, &len) < 0)
+ if (getsockopt(s, SOL_SOCKET, SO_ERROR, &error, &len) == -1)
return -1;
if (error != 0) {
errno = error;
@@ -144,7 +144,7 @@ int retcode;
\&...
for (retcode = connect(s, name, namelen);
- retcode != 0 && errno == EINTR;
+ retcode == -1 && errno == EINTR;
retcode = connect_wait(s))
continue;
if (retcode == -1)