diff options
author | Nicholas Clark <nick@ccl4.org> | 2006-02-12 19:03:47 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2006-02-12 19:03:47 +0000 |
commit | f4ae5be69aab22df54900ebee32a57ed082c7017 (patch) | |
tree | f801096a750d2512ff85fa146ee7a658c1ab1e64 /perlio.c | |
parent | eb6bf5f80c62bc2d2267b0782d9f373f88a3fefa (diff) | |
download | perl-f4ae5be69aab22df54900ebee32a57ed082c7017.tar.gz |
Fix change 27059 so that it actually works with >16 file descriptors.
With programmers like these, we need Stadler & Waldorf on code review.
p4raw-id: //depot/perl@27166
Diffstat (limited to 'perlio.c')
-rw-r--r-- | perlio.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -2249,7 +2249,7 @@ perl_mutex PerlIO_mutex; static void S_more_refcounted_fds(pTHX_ const int new_fd) { const int old_max = PL_perlio_fd_refcnt_size; - const int new_max = 16 + (new_fd & 15); + const int new_max = 16 + (new_fd & ~15); int *new_array; PerlIO_debug("More fds - old=%d, need %d, new=%d\n", @@ -2259,6 +2259,8 @@ S_more_refcounted_fds(pTHX_ const int new_fd) { return; } + assert (new_max > new_fd); + new_array = PerlMemShared_realloc(PL_perlio_fd_refcnt, new_max * sizeof(int)); |