commit-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[hurd,commited] tst-cancel4-common.c: fix calling socketpair


From: Samuel Thibault
Subject: [hurd,commited] tst-cancel4-common.c: fix calling socketpair
Date: Fri, 26 Jun 2020 23:52:40 +0200

PF_UNIX was actually never intended to be passed as protocol parameter to
socket() calls: it is a protocol family, not a protocol.  It happens that
Linux introduced accepting it during its 2.0 development, but it shouldn't.
OpenBSD kernels accept it as well, but FreeBSD and NetBSD rightfully do not.
GNU/Hurd does not either.

* nptl/tst-cancel4-common.c (do_test): Pass 0 instead of PF_UNIX as
protocol.
---
 nptl/tst-cancel4-common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/nptl/tst-cancel4-common.c b/nptl/tst-cancel4-common.c
index f2026b81f4..9a6924c1c6 100644
--- a/nptl/tst-cancel4-common.c
+++ b/nptl/tst-cancel4-common.c
@@ -20,7 +20,7 @@
 static int
 do_test (void)
 {
-  if (socketpair (AF_UNIX, SOCK_STREAM, PF_UNIX, fds) != 0)
+  if (socketpair (AF_UNIX, SOCK_STREAM, 0, fds) != 0)
     {
       perror ("socketpair");
       exit (1);
-- 
2.27.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]