delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1996/09/24/13:17:25

Date: Tue, 24 Sep 1996 19:11:21 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: DJ Delorie <dj AT delorie DOT com>
Cc: djgpp-workers AT delorie DOT com
Subject: Re: alpha 960919
In-Reply-To: <199609200412.AAA27520@delorie.com>
Message-Id: <Pine.SUN.3.91.960924190737.12314E-100000@is>
Mime-Version: 1.0

On Fri, 20 Sep 1996, DJ Delorie wrote:

> Has anyone looked at the dup2(0,50) bug yet?

How about the patch below?  Can whoever reported the problem please test 
this and see if it solves the bug?

*** src/libc/posix/unistd/dup2.c~0	Mon Feb 27 00:43:08 1995
--- src/libc/posix/unistd/dup2.c	Tue Sep 24 19:01:44 1996
***************
*** 1,6 ****
--- 1,7 ----
  /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
  #include <libc/stubs.h>
  #include <unistd.h>
+ #include <fcntl.h>
  #include <dpmi.h>
  #include <errno.h>
  #include <io.h>
***************
*** 12,17 ****
--- 13,19 ----
    __dpmi_regs r;
    if (fd == newfd)
      return newfd;
+   __file_handle_set(newfd, __file_handle_modes[fd] ^ (O_BINARY|O_TEXT));
    r.h.ah = 0x46;
    r.x.bx = fd;
    r.x.cx = newfd;

- Raw text -


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