File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -406,6 +406,9 @@ int mingw_raise(int sig);
406
406
int winansi_isatty (int fd );
407
407
#define isatty winansi_isatty
408
408
409
+ int winansi_dup2 (int oldfd , int newfd );
410
+ #define dup2 winansi_dup2
411
+
409
412
void winansi_init (void );
410
413
HANDLE winansi_get_osfhandle (int fd );
411
414
Original file line number Diff line number Diff line change @@ -474,6 +474,18 @@ static void die_lasterr(const char *fmt, ...)
474
474
va_end (params );
475
475
}
476
476
477
+ #undef dup2
478
+ int winansi_dup2 (int oldfd , int newfd )
479
+ {
480
+ int ret = dup2 (oldfd , newfd );
481
+
482
+ if (!ret && newfd >= 0 && newfd <= 2 )
483
+ fd_is_interactive [newfd ] = oldfd < 0 || oldfd > 2 ?
484
+ 0 : fd_is_interactive [oldfd ];
485
+
486
+ return ret ;
487
+ }
488
+
477
489
static HANDLE duplicate_handle (HANDLE hnd )
478
490
{
479
491
HANDLE hresult , hproc = GetCurrentProcess ();
You can’t perform that action at this time.
0 commit comments