Mail Archives: djgpp-workers/1996/09/24/13:17:25
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 -