diff options
author | Kurt Miller <kurt@cvs.openbsd.org> | 2007-04-27 12:59:25 +0000 |
---|---|---|
committer | Kurt Miller <kurt@cvs.openbsd.org> | 2007-04-27 12:59:25 +0000 |
commit | 630660d7b52dc94cc09f34d86fa9769393252230 (patch) | |
tree | d4e8479f2315cfafe04a60ddee550d147281a31c /lib/libpthread/uthread/uthread_dup2.c | |
parent | 52bd0be9d83b6d1543ab6944712130da1d07acdc (diff) |
Use rlimit nofiles max to size fd/fdp tables instead of cur. Fixes
applications that increase nofiles using setrlimit(2). ok marc@
Diffstat (limited to 'lib/libpthread/uthread/uthread_dup2.c')
-rw-r--r-- | lib/libpthread/uthread/uthread_dup2.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libpthread/uthread/uthread_dup2.c b/lib/libpthread/uthread/uthread_dup2.c index 0ed5578686f..8bd4d5b4bba 100644 --- a/lib/libpthread/uthread/uthread_dup2.c +++ b/lib/libpthread/uthread/uthread_dup2.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uthread_dup2.c,v 1.10 2006/10/03 02:29:14 kurt Exp $ */ +/* $OpenBSD: uthread_dup2.c,v 1.11 2007/04/27 12:59:24 kurt Exp $ */ /* PUBLIC DOMAIN <marc@snafu.org> */ #include <errno.h> @@ -13,7 +13,7 @@ dup2(int fd, int newfd) int ret; int saved_errno; - if (newfd >= 0 && newfd < _thread_dtablesize && + if (newfd >= 0 && newfd < _thread_max_fdtsize && newfd != _thread_kern_pipe[0] && newfd != _thread_kern_pipe[1]) { ret = _FD_LOCK(fd, FD_RDWR, NULL); if (ret == 0) { |