Mail Archives: djgpp-workers/1996/09/16/04:00:20
> Please send unrelated changes in separate mails from now on. Also, I
> prefer Eli's diff format (one big text diff, relative to the top
> directory) rather than a zip of diffs all over the place, because I
> can just run patch once to apply them.
Ok, I do so.
> Why does this even bother trying to grow the file handle table? dup2
> does this for you.
It's mistake.
*** src/libc/posix/fcntl/fcntl.c-orig Sun Sep 15 06:01:26 1996
--- src/libc/posix/fcntl/fcntl.c Mon Sep 16 16:18:06 1996
***************
*** 7,16 ****
#include <unistd.h>
#include <fcntl.h>
#include <sys/fsext.h>
- #include <libc/dosio.h>
-
- /* djgpp uses 20 handle by default, the value comes from dos/io/dosio.c */
- static int default_open_max = 20;
static int
is_used_fd(int fd)
--- 7,12 ----
***************
*** 26,37 ****
return 1;
}
- static void
- grow_up_table(void)
- {
- __file_handle_set(default_open_max-1, __file_handle_modes[default_open_max-1]);
- }
-
int
fcntl(int fd, int cmd, ...)
{
--- 22,27 ----
***************
*** 65,73 ****
errno = EMFILE;
return -1;
}
-
- if (tofd >= default_open_max)
- grow_up_table();
return dup2(fd, tofd);
--- 55,60 ----
------
Daisuke Aoyama
jack AT st DOT rim DOT or DOT jp
- Raw text -