Fix for using named pipes on Windows
On Windows, passing a named pipe as terminal argument to the new-ui
command does not work.
The problem is that the new_ui_command function in top.c opens the
same tty three times, for stdin, stdout and stderr. With Windows
named pipes, the second and third calls to open fail.
Opening the file only once and passing the same stream for stdin,
stdout and stderr makes it work.
Pedro says:
I tried it on GNU/Linux and things still work.
I ran all the MI tests with forced new-ui, with:
$ make check TESTS="gdb.mi/*.exp" RUNTESTFLAGS="FORCE_MI_SEPARATE_UI=1"
and saw no regressions.
gdb/ChangeLog:
2019-07-18 Guillaume LABARTHE <guillaume.labarthe@gmail.com>
* top.c (new_ui_command): Open specified terminal just once.