Mercurial > hg > octave-kai > gnulib-hg
changeset 17118:00956ff1864c
select, poll tests: Make setsockopt invocation effective.
* tests/test-poll.c (open_server_socket): Move setsockopt() call before
the bind() call.
* tests/test-select.h (open_server_socket): Likewise.
author | Ed Maste <emaste@freebsd.org> |
---|---|
date | Tue, 02 Oct 2012 01:48:22 +0200 |
parents | 622e1fb82f06 |
children | 973b259ceb42 |
files | ChangeLog tests/test-poll.c tests/test-select.h |
diffstat | 3 files changed, 13 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2012-10-01 Ed Maste <emaste@freebsd.org> (tiny change) + + select, poll tests: Make setsockopt invocation effective. + * tests/test-poll.c (open_server_socket): Move setsockopt() call before + the bind() call. + * tests/test-select.h (open_server_socket): Likewise. + 2012-09-30 Paul Eggert <eggert@cs.ucla.edu> sockets, sys_stat: restore AC_C_INLINE
--- a/tests/test-poll.c +++ b/tests/test-poll.c @@ -96,6 +96,9 @@ s = socket (AF_INET, SOCK_STREAM, 0); + x = 1; + setsockopt (s, SOL_SOCKET, SO_REUSEPORT, &x, sizeof (x)); + memset (&ia, 0, sizeof (ia)); ia.sin_family = AF_INET; inet_pton (AF_INET, "127.0.0.1", &ia.sin_addr); @@ -106,9 +109,6 @@ exit (77); } - x = 1; - setsockopt (s, SOL_SOCKET, SO_REUSEPORT, &x, sizeof (x)); - if (listen (s, 1) < 0) { perror ("listen");
--- a/tests/test-select.h +++ b/tests/test-select.h @@ -84,6 +84,9 @@ s = socket (AF_INET, SOCK_STREAM, 0); + x = 1; + setsockopt (s, SOL_SOCKET, SO_REUSEPORT, &x, sizeof (x)); + memset (&ia, 0, sizeof (ia)); ia.sin_family = AF_INET; inet_pton (AF_INET, "127.0.0.1", &ia.sin_addr); @@ -94,9 +97,6 @@ exit (77); } - x = 1; - setsockopt (s, SOL_SOCKET, SO_REUSEPORT, &x, sizeof (x)); - if (listen (s, 1) < 0) { perror ("listen");