bug-gnulib
[Top][All Lists]
Advanced

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

[PATCH] Fix test-accept4 on FreeBSD


From: Pino Toscano
Subject: [PATCH] Fix test-accept4 on FreeBSD
Date: Thu, 8 Oct 2015 14:47:55 +0200

Hi,

currently, test-accept4 asserts on FreeBSD 10.1-RELEASE, as the errno
returned on accept4 failures is reported as EINVAL (and not EBADF as
expected).

The issue is due to wrong flags passed to accept4 in the test itself:
both the Linux [1] and the FreeBSD [2] man pages document only SOCK_*
flags allowed, and the test currently work on GNU/Linux because
O_CLOEXEC == SOCK_CLOEXEC (and O_NONBLOCK == SOCK_NONBLOCK) and
O_BINARY is defined as 0 by gnulib itself.

Passing only SOCK_CLOEXEC makes the test work on both GNU/Linux
(tested on Fedora 21) and FreeBSD (10.1-RELEASE).

[1] http://linux.die.net/man/2/accept4
[2] https://www.freebsd.org/cgi/man.cgi?query=accept4&sektion=

Thanks,


Pino Toscano (1):
  accept4 tests: fix specified flags

 ChangeLog            | 7 +++++++
 tests/test-accept4.c | 4 ++--
 2 files changed, 9 insertions(+), 2 deletions(-)

-- 
2.1.0




reply via email to

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