summaryrefslogtreecommitdiff
path: root/regress/lib/libpthread/close
diff options
context:
space:
mode:
authorMarco S Hyman <marc@cvs.openbsd.org>2004-01-08 04:19:20 +0000
committerMarco S Hyman <marc@cvs.openbsd.org>2004-01-08 04:19:20 +0000
commit2e337c3aa298ababeed093a5538e3c357418163f (patch)
tree67a986d08aa1c89dd1454529f0dae8279e81ff2a /regress/lib/libpthread/close
parentd1b89006acbf6a80c2f1acbde2524d27d5a5ec50 (diff)
Update regression test to match current library semantics. A select
is supposed to fail with EBADF if another thread closes the fd/socket that is being selected.
Diffstat (limited to 'regress/lib/libpthread/close')
-rw-r--r--regress/lib/libpthread/close/close.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/regress/lib/libpthread/close/close.c b/regress/lib/libpthread/close/close.c
index 1ef4bf70091..ed218f153f8 100644
--- a/regress/lib/libpthread/close/close.c
+++ b/regress/lib/libpthread/close/close.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: close.c,v 1.4 2003/07/31 21:48:04 deraadt Exp $ */
+/* $OpenBSD: close.c,v 1.5 2004/01/08 04:19:19 marc Exp $ */
/*
* Copyright (c) 1993, 1994, 1995, 1996 by Chris Provenzano and contributors,
* proven@mit.edu All rights reserved.
@@ -107,8 +107,10 @@ new_thread(void* arg)
printf("child: writing some garbage to fd %d\n", fd);
CHECKe(write(fd, garbage, sizeof garbage));
printf("child: calling select() with fd %d\n", fd);
- CHECKe(ret = select(fd + 1, &r, NULL, NULL, NULL));
- printf("child: select() returned %d\n", ret);
+ ASSERT((ret = select(fd + 1, &r, NULL, NULL, NULL)) == -1);
+ ASSERT(errno == EBADF);
+ printf("child: select() returned %d, errno %d = %s [correct]\n", ret,
+ errno, strerror(errno));
return NULL;
}