delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1996/09/16/04:00:20

Message-Id: <199609160757.QAA00291@mars.st.rim.or.jp>
To: dj AT delorie DOT com (DJ Delorie)
Cc: djgpp-workers AT delorie DOT com
Subject: Re: diffs from 960908
In-reply-to: Your message of "Sun, 15 Sep 1996 15:51:25 -0400"
References: <199609151951 DOT PAA27959 AT delorie DOT com>
Mime-Version: 1.0
Date: Mon, 16 Sep 1996 16:57:34 +0900
From: =?ISO-2022-JP?B?GyRCQEQ7M0JnMnAbKEI=?= /Daisuke Aoyama <jack AT st DOT rim DOT or DOT jp>

> 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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019