diff options
author | Marco S Hyman <marc@cvs.openbsd.org> | 2002-10-12 19:02:52 +0000 |
---|---|---|
committer | Marco S Hyman <marc@cvs.openbsd.org> | 2002-10-12 19:02:52 +0000 |
commit | e9d8842bbce2a07775747a16affc1e98db77859d (patch) | |
tree | d6b21b55eb8a370c8ba44abb2aad103acb8d3ebb /regress/lib | |
parent | dbf5894c02c9ab39c5159f4ab0d1f8681041bf44 (diff) |
Enable test for proper inheritance of NONBLOCK flag on accept.
The test will fail -- a reminder that I still need to fix this.
Diffstat (limited to 'regress/lib')
-rw-r--r-- | regress/lib/libc_r/socket/3/socket3.c | 6 | ||||
-rw-r--r-- | regress/lib/libpthread/socket/3/socket3.c | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/regress/lib/libc_r/socket/3/socket3.c b/regress/lib/libc_r/socket/3/socket3.c index 03242f6768f..5f17bf9571c 100644 --- a/regress/lib/libc_r/socket/3/socket3.c +++ b/regress/lib/libc_r/socket/3/socket3.c @@ -1,4 +1,4 @@ -/* $OpenBSD: socket3.c,v 1.1 2002/10/10 00:45:20 marc Exp $ */ +/* $OpenBSD: socket3.c,v 1.2 2002/10/12 19:02:51 marc Exp $ */ /* PUBLIC DOMAIN Oct 2002 <marc@snafu.org> */ /* Test blocking/non-blocking mode inheritance on accept */ @@ -100,10 +100,10 @@ sock_accept(void *arg) CHECKe(close(STDIN_FILENO)); accept_sa_size = sizeof accept_sa; CHECKe(accept_fd = accept(listen_fd, &accept_sa, &accept_sa_size)); + /* verify O_NONBLOCK on the accepted fd */ flags = fcntl(accept_fd, F_GETFL); printf("accept_fd = %d, flags = %x\n", accept_fd, flags); - /* XXX the above should abort if flags & O_NOBLOCK is zero */ - /* ASSERT(flags & O_NONBLOCK); */ + ASSERT(flags & O_NONBLOCK); CHECKe(close(listen_fd)); CHECKe(close(accept_fd)); CHECKr(pthread_join(connect_thread, NULL)); diff --git a/regress/lib/libpthread/socket/3/socket3.c b/regress/lib/libpthread/socket/3/socket3.c index 03242f6768f..5f17bf9571c 100644 --- a/regress/lib/libpthread/socket/3/socket3.c +++ b/regress/lib/libpthread/socket/3/socket3.c @@ -1,4 +1,4 @@ -/* $OpenBSD: socket3.c,v 1.1 2002/10/10 00:45:20 marc Exp $ */ +/* $OpenBSD: socket3.c,v 1.2 2002/10/12 19:02:51 marc Exp $ */ /* PUBLIC DOMAIN Oct 2002 <marc@snafu.org> */ /* Test blocking/non-blocking mode inheritance on accept */ @@ -100,10 +100,10 @@ sock_accept(void *arg) CHECKe(close(STDIN_FILENO)); accept_sa_size = sizeof accept_sa; CHECKe(accept_fd = accept(listen_fd, &accept_sa, &accept_sa_size)); + /* verify O_NONBLOCK on the accepted fd */ flags = fcntl(accept_fd, F_GETFL); printf("accept_fd = %d, flags = %x\n", accept_fd, flags); - /* XXX the above should abort if flags & O_NOBLOCK is zero */ - /* ASSERT(flags & O_NONBLOCK); */ + ASSERT(flags & O_NONBLOCK); CHECKe(close(listen_fd)); CHECKe(close(accept_fd)); CHECKr(pthread_join(connect_thread, NULL)); |