Throughout change TTY_* to PTY_*, tty_* to pty_*, and ttym_* to ptmx_*.

* devices.cc: Regenerate.
* dtable.cc: (fh_alloc): Preserve /dev/tty name when that's what we opened.
(build_fh_pc): Preserve any existing name.
* fhandler.cc (fhandler_base::open_with_arch): Ditto.
* fhandler_tty.cc (fhandler_pty_master::fhandler_pty_master): Force the name to
/dev/ptmx while preserving other pty master device information.
* path.h (cfree_maybe): New macro.
(path_conv::operator =): Free any allocated strings in target.
(path_conv::free_strings): Delete unused function.
* sigproc.cc (proc_terminate): Remove previous accommodation for execed
processes since it didn't have the desired effect.  Change comment to a FIXME.
* spawn.cc (chExeced): Mark NO_COPY.
(exe_suffixes): Ditto.
This commit is contained in:
Christopher Faylor 2011-10-20 14:02:54 +00:00
parent aa982024d1
commit 38d732a152
14 changed files with 211 additions and 171 deletions

View File

@ -1,3 +1,24 @@
2011-10-20 Christopher Faylor <me.cygwin2011@cgf.cx>
Throughout change TTY_* to PTY_*, tty_* to pty_*, and ttym_* to ptmx_*.
* devices.cc: Regenerate.
* dtable.cc: (fh_alloc): Preserve /dev/tty name when that's what we
opened.
(build_fh_pc): Preserve any existing name.
* fhandler.cc (fhandler_base::open_with_arch): Ditto.
* fhandler_tty.cc (fhandler_pty_master::fhandler_pty_master): Force the
name to /dev/ptmx while preserving other pty master device information.
* path.h (cfree_maybe): New macro.
(path_conv::operator =): Free any allocated strings in target.
(path_conv::free_strings): Delete unused function.
* sigproc.cc (proc_terminate): Remove previous accommodation for execed
processes since it didn't have the desired effect. Change comment to a
FIXME.
* spawn.cc (chExeced): Mark NO_COPY.
(exe_suffixes): Ditto.
2011-10-20 Corinna Vinschen <corinna@vinschen.de>
* syscalls.cc (try_to_bin): Improve debug output.

View File

@ -307,134 +307,134 @@ static const device dev_storage[] =
{"/dev/pipe", BRACK(FH_PIPE), "/dev/pipe"},
{"/dev/port", BRACK(FH_PORT), "/dev/port"},
{"/dev/ptmx", BRACK(FH_PTMX), "/dev/ptmx"},
{"/dev/pty0", BRACK(FHDEV(DEV_TTYS_MAJOR, 0)), "/dev/pty0"},
{"/dev/pty1", BRACK(FHDEV(DEV_TTYS_MAJOR, 1)), "/dev/pty1"},
{"/dev/pty2", BRACK(FHDEV(DEV_TTYS_MAJOR, 2)), "/dev/pty2"},
{"/dev/pty3", BRACK(FHDEV(DEV_TTYS_MAJOR, 3)), "/dev/pty3"},
{"/dev/pty4", BRACK(FHDEV(DEV_TTYS_MAJOR, 4)), "/dev/pty4"},
{"/dev/pty5", BRACK(FHDEV(DEV_TTYS_MAJOR, 5)), "/dev/pty5"},
{"/dev/pty6", BRACK(FHDEV(DEV_TTYS_MAJOR, 6)), "/dev/pty6"},
{"/dev/pty7", BRACK(FHDEV(DEV_TTYS_MAJOR, 7)), "/dev/pty7"},
{"/dev/pty8", BRACK(FHDEV(DEV_TTYS_MAJOR, 8)), "/dev/pty8"},
{"/dev/pty9", BRACK(FHDEV(DEV_TTYS_MAJOR, 9)), "/dev/pty9"},
{"/dev/pty10", BRACK(FHDEV(DEV_TTYS_MAJOR, 10)), "/dev/pty10"},
{"/dev/pty11", BRACK(FHDEV(DEV_TTYS_MAJOR, 11)), "/dev/pty11"},
{"/dev/pty12", BRACK(FHDEV(DEV_TTYS_MAJOR, 12)), "/dev/pty12"},
{"/dev/pty13", BRACK(FHDEV(DEV_TTYS_MAJOR, 13)), "/dev/pty13"},
{"/dev/pty14", BRACK(FHDEV(DEV_TTYS_MAJOR, 14)), "/dev/pty14"},
{"/dev/pty15", BRACK(FHDEV(DEV_TTYS_MAJOR, 15)), "/dev/pty15"},
{"/dev/pty16", BRACK(FHDEV(DEV_TTYS_MAJOR, 16)), "/dev/pty16"},
{"/dev/pty17", BRACK(FHDEV(DEV_TTYS_MAJOR, 17)), "/dev/pty17"},
{"/dev/pty18", BRACK(FHDEV(DEV_TTYS_MAJOR, 18)), "/dev/pty18"},
{"/dev/pty19", BRACK(FHDEV(DEV_TTYS_MAJOR, 19)), "/dev/pty19"},
{"/dev/pty20", BRACK(FHDEV(DEV_TTYS_MAJOR, 20)), "/dev/pty20"},
{"/dev/pty21", BRACK(FHDEV(DEV_TTYS_MAJOR, 21)), "/dev/pty21"},
{"/dev/pty22", BRACK(FHDEV(DEV_TTYS_MAJOR, 22)), "/dev/pty22"},
{"/dev/pty23", BRACK(FHDEV(DEV_TTYS_MAJOR, 23)), "/dev/pty23"},
{"/dev/pty24", BRACK(FHDEV(DEV_TTYS_MAJOR, 24)), "/dev/pty24"},
{"/dev/pty25", BRACK(FHDEV(DEV_TTYS_MAJOR, 25)), "/dev/pty25"},
{"/dev/pty26", BRACK(FHDEV(DEV_TTYS_MAJOR, 26)), "/dev/pty26"},
{"/dev/pty27", BRACK(FHDEV(DEV_TTYS_MAJOR, 27)), "/dev/pty27"},
{"/dev/pty28", BRACK(FHDEV(DEV_TTYS_MAJOR, 28)), "/dev/pty28"},
{"/dev/pty29", BRACK(FHDEV(DEV_TTYS_MAJOR, 29)), "/dev/pty29"},
{"/dev/pty30", BRACK(FHDEV(DEV_TTYS_MAJOR, 30)), "/dev/pty30"},
{"/dev/pty31", BRACK(FHDEV(DEV_TTYS_MAJOR, 31)), "/dev/pty31"},
{"/dev/pty32", BRACK(FHDEV(DEV_TTYS_MAJOR, 32)), "/dev/pty32"},
{"/dev/pty33", BRACK(FHDEV(DEV_TTYS_MAJOR, 33)), "/dev/pty33"},
{"/dev/pty34", BRACK(FHDEV(DEV_TTYS_MAJOR, 34)), "/dev/pty34"},
{"/dev/pty35", BRACK(FHDEV(DEV_TTYS_MAJOR, 35)), "/dev/pty35"},
{"/dev/pty36", BRACK(FHDEV(DEV_TTYS_MAJOR, 36)), "/dev/pty36"},
{"/dev/pty37", BRACK(FHDEV(DEV_TTYS_MAJOR, 37)), "/dev/pty37"},
{"/dev/pty38", BRACK(FHDEV(DEV_TTYS_MAJOR, 38)), "/dev/pty38"},
{"/dev/pty39", BRACK(FHDEV(DEV_TTYS_MAJOR, 39)), "/dev/pty39"},
{"/dev/pty40", BRACK(FHDEV(DEV_TTYS_MAJOR, 40)), "/dev/pty40"},
{"/dev/pty41", BRACK(FHDEV(DEV_TTYS_MAJOR, 41)), "/dev/pty41"},
{"/dev/pty42", BRACK(FHDEV(DEV_TTYS_MAJOR, 42)), "/dev/pty42"},
{"/dev/pty43", BRACK(FHDEV(DEV_TTYS_MAJOR, 43)), "/dev/pty43"},
{"/dev/pty44", BRACK(FHDEV(DEV_TTYS_MAJOR, 44)), "/dev/pty44"},
{"/dev/pty45", BRACK(FHDEV(DEV_TTYS_MAJOR, 45)), "/dev/pty45"},
{"/dev/pty46", BRACK(FHDEV(DEV_TTYS_MAJOR, 46)), "/dev/pty46"},
{"/dev/pty47", BRACK(FHDEV(DEV_TTYS_MAJOR, 47)), "/dev/pty47"},
{"/dev/pty48", BRACK(FHDEV(DEV_TTYS_MAJOR, 48)), "/dev/pty48"},
{"/dev/pty49", BRACK(FHDEV(DEV_TTYS_MAJOR, 49)), "/dev/pty49"},
{"/dev/pty50", BRACK(FHDEV(DEV_TTYS_MAJOR, 50)), "/dev/pty50"},
{"/dev/pty51", BRACK(FHDEV(DEV_TTYS_MAJOR, 51)), "/dev/pty51"},
{"/dev/pty52", BRACK(FHDEV(DEV_TTYS_MAJOR, 52)), "/dev/pty52"},
{"/dev/pty53", BRACK(FHDEV(DEV_TTYS_MAJOR, 53)), "/dev/pty53"},
{"/dev/pty54", BRACK(FHDEV(DEV_TTYS_MAJOR, 54)), "/dev/pty54"},
{"/dev/pty55", BRACK(FHDEV(DEV_TTYS_MAJOR, 55)), "/dev/pty55"},
{"/dev/pty56", BRACK(FHDEV(DEV_TTYS_MAJOR, 56)), "/dev/pty56"},
{"/dev/pty57", BRACK(FHDEV(DEV_TTYS_MAJOR, 57)), "/dev/pty57"},
{"/dev/pty58", BRACK(FHDEV(DEV_TTYS_MAJOR, 58)), "/dev/pty58"},
{"/dev/pty59", BRACK(FHDEV(DEV_TTYS_MAJOR, 59)), "/dev/pty59"},
{"/dev/pty60", BRACK(FHDEV(DEV_TTYS_MAJOR, 60)), "/dev/pty60"},
{"/dev/pty61", BRACK(FHDEV(DEV_TTYS_MAJOR, 61)), "/dev/pty61"},
{"/dev/pty62", BRACK(FHDEV(DEV_TTYS_MAJOR, 62)), "/dev/pty62"},
{"/dev/pty63", BRACK(FHDEV(DEV_TTYS_MAJOR, 63)), "/dev/pty63"},
{"/dev/ptym0", BRACK(FHDEV(DEV_TTYM_MAJOR, 0)), "/dev/ptym0"},
{"/dev/ptym1", BRACK(FHDEV(DEV_TTYM_MAJOR, 1)), "/dev/ptym1"},
{"/dev/ptym2", BRACK(FHDEV(DEV_TTYM_MAJOR, 2)), "/dev/ptym2"},
{"/dev/ptym3", BRACK(FHDEV(DEV_TTYM_MAJOR, 3)), "/dev/ptym3"},
{"/dev/ptym4", BRACK(FHDEV(DEV_TTYM_MAJOR, 4)), "/dev/ptym4"},
{"/dev/ptym5", BRACK(FHDEV(DEV_TTYM_MAJOR, 5)), "/dev/ptym5"},
{"/dev/ptym6", BRACK(FHDEV(DEV_TTYM_MAJOR, 6)), "/dev/ptym6"},
{"/dev/ptym7", BRACK(FHDEV(DEV_TTYM_MAJOR, 7)), "/dev/ptym7"},
{"/dev/ptym8", BRACK(FHDEV(DEV_TTYM_MAJOR, 8)), "/dev/ptym8"},
{"/dev/ptym9", BRACK(FHDEV(DEV_TTYM_MAJOR, 9)), "/dev/ptym9"},
{"/dev/ptym10", BRACK(FHDEV(DEV_TTYM_MAJOR, 10)), "/dev/ptym10"},
{"/dev/ptym11", BRACK(FHDEV(DEV_TTYM_MAJOR, 11)), "/dev/ptym11"},
{"/dev/ptym12", BRACK(FHDEV(DEV_TTYM_MAJOR, 12)), "/dev/ptym12"},
{"/dev/ptym13", BRACK(FHDEV(DEV_TTYM_MAJOR, 13)), "/dev/ptym13"},
{"/dev/ptym14", BRACK(FHDEV(DEV_TTYM_MAJOR, 14)), "/dev/ptym14"},
{"/dev/ptym15", BRACK(FHDEV(DEV_TTYM_MAJOR, 15)), "/dev/ptym15"},
{"/dev/ptym16", BRACK(FHDEV(DEV_TTYM_MAJOR, 16)), "/dev/ptym16"},
{"/dev/ptym17", BRACK(FHDEV(DEV_TTYM_MAJOR, 17)), "/dev/ptym17"},
{"/dev/ptym18", BRACK(FHDEV(DEV_TTYM_MAJOR, 18)), "/dev/ptym18"},
{"/dev/ptym19", BRACK(FHDEV(DEV_TTYM_MAJOR, 19)), "/dev/ptym19"},
{"/dev/ptym20", BRACK(FHDEV(DEV_TTYM_MAJOR, 20)), "/dev/ptym20"},
{"/dev/ptym21", BRACK(FHDEV(DEV_TTYM_MAJOR, 21)), "/dev/ptym21"},
{"/dev/ptym22", BRACK(FHDEV(DEV_TTYM_MAJOR, 22)), "/dev/ptym22"},
{"/dev/ptym23", BRACK(FHDEV(DEV_TTYM_MAJOR, 23)), "/dev/ptym23"},
{"/dev/ptym24", BRACK(FHDEV(DEV_TTYM_MAJOR, 24)), "/dev/ptym24"},
{"/dev/ptym25", BRACK(FHDEV(DEV_TTYM_MAJOR, 25)), "/dev/ptym25"},
{"/dev/ptym26", BRACK(FHDEV(DEV_TTYM_MAJOR, 26)), "/dev/ptym26"},
{"/dev/ptym27", BRACK(FHDEV(DEV_TTYM_MAJOR, 27)), "/dev/ptym27"},
{"/dev/ptym28", BRACK(FHDEV(DEV_TTYM_MAJOR, 28)), "/dev/ptym28"},
{"/dev/ptym29", BRACK(FHDEV(DEV_TTYM_MAJOR, 29)), "/dev/ptym29"},
{"/dev/ptym30", BRACK(FHDEV(DEV_TTYM_MAJOR, 30)), "/dev/ptym30"},
{"/dev/ptym31", BRACK(FHDEV(DEV_TTYM_MAJOR, 31)), "/dev/ptym31"},
{"/dev/ptym32", BRACK(FHDEV(DEV_TTYM_MAJOR, 32)), "/dev/ptym32"},
{"/dev/ptym33", BRACK(FHDEV(DEV_TTYM_MAJOR, 33)), "/dev/ptym33"},
{"/dev/ptym34", BRACK(FHDEV(DEV_TTYM_MAJOR, 34)), "/dev/ptym34"},
{"/dev/ptym35", BRACK(FHDEV(DEV_TTYM_MAJOR, 35)), "/dev/ptym35"},
{"/dev/ptym36", BRACK(FHDEV(DEV_TTYM_MAJOR, 36)), "/dev/ptym36"},
{"/dev/ptym37", BRACK(FHDEV(DEV_TTYM_MAJOR, 37)), "/dev/ptym37"},
{"/dev/ptym38", BRACK(FHDEV(DEV_TTYM_MAJOR, 38)), "/dev/ptym38"},
{"/dev/ptym39", BRACK(FHDEV(DEV_TTYM_MAJOR, 39)), "/dev/ptym39"},
{"/dev/ptym40", BRACK(FHDEV(DEV_TTYM_MAJOR, 40)), "/dev/ptym40"},
{"/dev/ptym41", BRACK(FHDEV(DEV_TTYM_MAJOR, 41)), "/dev/ptym41"},
{"/dev/ptym42", BRACK(FHDEV(DEV_TTYM_MAJOR, 42)), "/dev/ptym42"},
{"/dev/ptym43", BRACK(FHDEV(DEV_TTYM_MAJOR, 43)), "/dev/ptym43"},
{"/dev/ptym44", BRACK(FHDEV(DEV_TTYM_MAJOR, 44)), "/dev/ptym44"},
{"/dev/ptym45", BRACK(FHDEV(DEV_TTYM_MAJOR, 45)), "/dev/ptym45"},
{"/dev/ptym46", BRACK(FHDEV(DEV_TTYM_MAJOR, 46)), "/dev/ptym46"},
{"/dev/ptym47", BRACK(FHDEV(DEV_TTYM_MAJOR, 47)), "/dev/ptym47"},
{"/dev/ptym48", BRACK(FHDEV(DEV_TTYM_MAJOR, 48)), "/dev/ptym48"},
{"/dev/ptym49", BRACK(FHDEV(DEV_TTYM_MAJOR, 49)), "/dev/ptym49"},
{"/dev/ptym50", BRACK(FHDEV(DEV_TTYM_MAJOR, 50)), "/dev/ptym50"},
{"/dev/ptym51", BRACK(FHDEV(DEV_TTYM_MAJOR, 51)), "/dev/ptym51"},
{"/dev/ptym52", BRACK(FHDEV(DEV_TTYM_MAJOR, 52)), "/dev/ptym52"},
{"/dev/ptym53", BRACK(FHDEV(DEV_TTYM_MAJOR, 53)), "/dev/ptym53"},
{"/dev/ptym54", BRACK(FHDEV(DEV_TTYM_MAJOR, 54)), "/dev/ptym54"},
{"/dev/ptym55", BRACK(FHDEV(DEV_TTYM_MAJOR, 55)), "/dev/ptym55"},
{"/dev/ptym56", BRACK(FHDEV(DEV_TTYM_MAJOR, 56)), "/dev/ptym56"},
{"/dev/ptym57", BRACK(FHDEV(DEV_TTYM_MAJOR, 57)), "/dev/ptym57"},
{"/dev/ptym58", BRACK(FHDEV(DEV_TTYM_MAJOR, 58)), "/dev/ptym58"},
{"/dev/ptym59", BRACK(FHDEV(DEV_TTYM_MAJOR, 59)), "/dev/ptym59"},
{"/dev/ptym60", BRACK(FHDEV(DEV_TTYM_MAJOR, 60)), "/dev/ptym60"},
{"/dev/ptym61", BRACK(FHDEV(DEV_TTYM_MAJOR, 61)), "/dev/ptym61"},
{"/dev/ptym62", BRACK(FHDEV(DEV_TTYM_MAJOR, 62)), "/dev/ptym62"},
{"/dev/ptym63", BRACK(FHDEV(DEV_TTYM_MAJOR, 63)), "/dev/ptym63"},
{"/dev/pty0", BRACK(FHDEV(DEV_PTYS_MAJOR, 0)), "/dev/pty0"},
{"/dev/pty1", BRACK(FHDEV(DEV_PTYS_MAJOR, 1)), "/dev/pty1"},
{"/dev/pty2", BRACK(FHDEV(DEV_PTYS_MAJOR, 2)), "/dev/pty2"},
{"/dev/pty3", BRACK(FHDEV(DEV_PTYS_MAJOR, 3)), "/dev/pty3"},
{"/dev/pty4", BRACK(FHDEV(DEV_PTYS_MAJOR, 4)), "/dev/pty4"},
{"/dev/pty5", BRACK(FHDEV(DEV_PTYS_MAJOR, 5)), "/dev/pty5"},
{"/dev/pty6", BRACK(FHDEV(DEV_PTYS_MAJOR, 6)), "/dev/pty6"},
{"/dev/pty7", BRACK(FHDEV(DEV_PTYS_MAJOR, 7)), "/dev/pty7"},
{"/dev/pty8", BRACK(FHDEV(DEV_PTYS_MAJOR, 8)), "/dev/pty8"},
{"/dev/pty9", BRACK(FHDEV(DEV_PTYS_MAJOR, 9)), "/dev/pty9"},
{"/dev/pty10", BRACK(FHDEV(DEV_PTYS_MAJOR, 10)), "/dev/pty10"},
{"/dev/pty11", BRACK(FHDEV(DEV_PTYS_MAJOR, 11)), "/dev/pty11"},
{"/dev/pty12", BRACK(FHDEV(DEV_PTYS_MAJOR, 12)), "/dev/pty12"},
{"/dev/pty13", BRACK(FHDEV(DEV_PTYS_MAJOR, 13)), "/dev/pty13"},
{"/dev/pty14", BRACK(FHDEV(DEV_PTYS_MAJOR, 14)), "/dev/pty14"},
{"/dev/pty15", BRACK(FHDEV(DEV_PTYS_MAJOR, 15)), "/dev/pty15"},
{"/dev/pty16", BRACK(FHDEV(DEV_PTYS_MAJOR, 16)), "/dev/pty16"},
{"/dev/pty17", BRACK(FHDEV(DEV_PTYS_MAJOR, 17)), "/dev/pty17"},
{"/dev/pty18", BRACK(FHDEV(DEV_PTYS_MAJOR, 18)), "/dev/pty18"},
{"/dev/pty19", BRACK(FHDEV(DEV_PTYS_MAJOR, 19)), "/dev/pty19"},
{"/dev/pty20", BRACK(FHDEV(DEV_PTYS_MAJOR, 20)), "/dev/pty20"},
{"/dev/pty21", BRACK(FHDEV(DEV_PTYS_MAJOR, 21)), "/dev/pty21"},
{"/dev/pty22", BRACK(FHDEV(DEV_PTYS_MAJOR, 22)), "/dev/pty22"},
{"/dev/pty23", BRACK(FHDEV(DEV_PTYS_MAJOR, 23)), "/dev/pty23"},
{"/dev/pty24", BRACK(FHDEV(DEV_PTYS_MAJOR, 24)), "/dev/pty24"},
{"/dev/pty25", BRACK(FHDEV(DEV_PTYS_MAJOR, 25)), "/dev/pty25"},
{"/dev/pty26", BRACK(FHDEV(DEV_PTYS_MAJOR, 26)), "/dev/pty26"},
{"/dev/pty27", BRACK(FHDEV(DEV_PTYS_MAJOR, 27)), "/dev/pty27"},
{"/dev/pty28", BRACK(FHDEV(DEV_PTYS_MAJOR, 28)), "/dev/pty28"},
{"/dev/pty29", BRACK(FHDEV(DEV_PTYS_MAJOR, 29)), "/dev/pty29"},
{"/dev/pty30", BRACK(FHDEV(DEV_PTYS_MAJOR, 30)), "/dev/pty30"},
{"/dev/pty31", BRACK(FHDEV(DEV_PTYS_MAJOR, 31)), "/dev/pty31"},
{"/dev/pty32", BRACK(FHDEV(DEV_PTYS_MAJOR, 32)), "/dev/pty32"},
{"/dev/pty33", BRACK(FHDEV(DEV_PTYS_MAJOR, 33)), "/dev/pty33"},
{"/dev/pty34", BRACK(FHDEV(DEV_PTYS_MAJOR, 34)), "/dev/pty34"},
{"/dev/pty35", BRACK(FHDEV(DEV_PTYS_MAJOR, 35)), "/dev/pty35"},
{"/dev/pty36", BRACK(FHDEV(DEV_PTYS_MAJOR, 36)), "/dev/pty36"},
{"/dev/pty37", BRACK(FHDEV(DEV_PTYS_MAJOR, 37)), "/dev/pty37"},
{"/dev/pty38", BRACK(FHDEV(DEV_PTYS_MAJOR, 38)), "/dev/pty38"},
{"/dev/pty39", BRACK(FHDEV(DEV_PTYS_MAJOR, 39)), "/dev/pty39"},
{"/dev/pty40", BRACK(FHDEV(DEV_PTYS_MAJOR, 40)), "/dev/pty40"},
{"/dev/pty41", BRACK(FHDEV(DEV_PTYS_MAJOR, 41)), "/dev/pty41"},
{"/dev/pty42", BRACK(FHDEV(DEV_PTYS_MAJOR, 42)), "/dev/pty42"},
{"/dev/pty43", BRACK(FHDEV(DEV_PTYS_MAJOR, 43)), "/dev/pty43"},
{"/dev/pty44", BRACK(FHDEV(DEV_PTYS_MAJOR, 44)), "/dev/pty44"},
{"/dev/pty45", BRACK(FHDEV(DEV_PTYS_MAJOR, 45)), "/dev/pty45"},
{"/dev/pty46", BRACK(FHDEV(DEV_PTYS_MAJOR, 46)), "/dev/pty46"},
{"/dev/pty47", BRACK(FHDEV(DEV_PTYS_MAJOR, 47)), "/dev/pty47"},
{"/dev/pty48", BRACK(FHDEV(DEV_PTYS_MAJOR, 48)), "/dev/pty48"},
{"/dev/pty49", BRACK(FHDEV(DEV_PTYS_MAJOR, 49)), "/dev/pty49"},
{"/dev/pty50", BRACK(FHDEV(DEV_PTYS_MAJOR, 50)), "/dev/pty50"},
{"/dev/pty51", BRACK(FHDEV(DEV_PTYS_MAJOR, 51)), "/dev/pty51"},
{"/dev/pty52", BRACK(FHDEV(DEV_PTYS_MAJOR, 52)), "/dev/pty52"},
{"/dev/pty53", BRACK(FHDEV(DEV_PTYS_MAJOR, 53)), "/dev/pty53"},
{"/dev/pty54", BRACK(FHDEV(DEV_PTYS_MAJOR, 54)), "/dev/pty54"},
{"/dev/pty55", BRACK(FHDEV(DEV_PTYS_MAJOR, 55)), "/dev/pty55"},
{"/dev/pty56", BRACK(FHDEV(DEV_PTYS_MAJOR, 56)), "/dev/pty56"},
{"/dev/pty57", BRACK(FHDEV(DEV_PTYS_MAJOR, 57)), "/dev/pty57"},
{"/dev/pty58", BRACK(FHDEV(DEV_PTYS_MAJOR, 58)), "/dev/pty58"},
{"/dev/pty59", BRACK(FHDEV(DEV_PTYS_MAJOR, 59)), "/dev/pty59"},
{"/dev/pty60", BRACK(FHDEV(DEV_PTYS_MAJOR, 60)), "/dev/pty60"},
{"/dev/pty61", BRACK(FHDEV(DEV_PTYS_MAJOR, 61)), "/dev/pty61"},
{"/dev/pty62", BRACK(FHDEV(DEV_PTYS_MAJOR, 62)), "/dev/pty62"},
{"/dev/pty63", BRACK(FHDEV(DEV_PTYS_MAJOR, 63)), "/dev/pty63"},
{"/dev/ptym0", BRACK(FHDEV(DEV_PTYM_MAJOR, 0)), "/dev/ptym0"},
{"/dev/ptym1", BRACK(FHDEV(DEV_PTYM_MAJOR, 1)), "/dev/ptym1"},
{"/dev/ptym2", BRACK(FHDEV(DEV_PTYM_MAJOR, 2)), "/dev/ptym2"},
{"/dev/ptym3", BRACK(FHDEV(DEV_PTYM_MAJOR, 3)), "/dev/ptym3"},
{"/dev/ptym4", BRACK(FHDEV(DEV_PTYM_MAJOR, 4)), "/dev/ptym4"},
{"/dev/ptym5", BRACK(FHDEV(DEV_PTYM_MAJOR, 5)), "/dev/ptym5"},
{"/dev/ptym6", BRACK(FHDEV(DEV_PTYM_MAJOR, 6)), "/dev/ptym6"},
{"/dev/ptym7", BRACK(FHDEV(DEV_PTYM_MAJOR, 7)), "/dev/ptym7"},
{"/dev/ptym8", BRACK(FHDEV(DEV_PTYM_MAJOR, 8)), "/dev/ptym8"},
{"/dev/ptym9", BRACK(FHDEV(DEV_PTYM_MAJOR, 9)), "/dev/ptym9"},
{"/dev/ptym10", BRACK(FHDEV(DEV_PTYM_MAJOR, 10)), "/dev/ptym10"},
{"/dev/ptym11", BRACK(FHDEV(DEV_PTYM_MAJOR, 11)), "/dev/ptym11"},
{"/dev/ptym12", BRACK(FHDEV(DEV_PTYM_MAJOR, 12)), "/dev/ptym12"},
{"/dev/ptym13", BRACK(FHDEV(DEV_PTYM_MAJOR, 13)), "/dev/ptym13"},
{"/dev/ptym14", BRACK(FHDEV(DEV_PTYM_MAJOR, 14)), "/dev/ptym14"},
{"/dev/ptym15", BRACK(FHDEV(DEV_PTYM_MAJOR, 15)), "/dev/ptym15"},
{"/dev/ptym16", BRACK(FHDEV(DEV_PTYM_MAJOR, 16)), "/dev/ptym16"},
{"/dev/ptym17", BRACK(FHDEV(DEV_PTYM_MAJOR, 17)), "/dev/ptym17"},
{"/dev/ptym18", BRACK(FHDEV(DEV_PTYM_MAJOR, 18)), "/dev/ptym18"},
{"/dev/ptym19", BRACK(FHDEV(DEV_PTYM_MAJOR, 19)), "/dev/ptym19"},
{"/dev/ptym20", BRACK(FHDEV(DEV_PTYM_MAJOR, 20)), "/dev/ptym20"},
{"/dev/ptym21", BRACK(FHDEV(DEV_PTYM_MAJOR, 21)), "/dev/ptym21"},
{"/dev/ptym22", BRACK(FHDEV(DEV_PTYM_MAJOR, 22)), "/dev/ptym22"},
{"/dev/ptym23", BRACK(FHDEV(DEV_PTYM_MAJOR, 23)), "/dev/ptym23"},
{"/dev/ptym24", BRACK(FHDEV(DEV_PTYM_MAJOR, 24)), "/dev/ptym24"},
{"/dev/ptym25", BRACK(FHDEV(DEV_PTYM_MAJOR, 25)), "/dev/ptym25"},
{"/dev/ptym26", BRACK(FHDEV(DEV_PTYM_MAJOR, 26)), "/dev/ptym26"},
{"/dev/ptym27", BRACK(FHDEV(DEV_PTYM_MAJOR, 27)), "/dev/ptym27"},
{"/dev/ptym28", BRACK(FHDEV(DEV_PTYM_MAJOR, 28)), "/dev/ptym28"},
{"/dev/ptym29", BRACK(FHDEV(DEV_PTYM_MAJOR, 29)), "/dev/ptym29"},
{"/dev/ptym30", BRACK(FHDEV(DEV_PTYM_MAJOR, 30)), "/dev/ptym30"},
{"/dev/ptym31", BRACK(FHDEV(DEV_PTYM_MAJOR, 31)), "/dev/ptym31"},
{"/dev/ptym32", BRACK(FHDEV(DEV_PTYM_MAJOR, 32)), "/dev/ptym32"},
{"/dev/ptym33", BRACK(FHDEV(DEV_PTYM_MAJOR, 33)), "/dev/ptym33"},
{"/dev/ptym34", BRACK(FHDEV(DEV_PTYM_MAJOR, 34)), "/dev/ptym34"},
{"/dev/ptym35", BRACK(FHDEV(DEV_PTYM_MAJOR, 35)), "/dev/ptym35"},
{"/dev/ptym36", BRACK(FHDEV(DEV_PTYM_MAJOR, 36)), "/dev/ptym36"},
{"/dev/ptym37", BRACK(FHDEV(DEV_PTYM_MAJOR, 37)), "/dev/ptym37"},
{"/dev/ptym38", BRACK(FHDEV(DEV_PTYM_MAJOR, 38)), "/dev/ptym38"},
{"/dev/ptym39", BRACK(FHDEV(DEV_PTYM_MAJOR, 39)), "/dev/ptym39"},
{"/dev/ptym40", BRACK(FHDEV(DEV_PTYM_MAJOR, 40)), "/dev/ptym40"},
{"/dev/ptym41", BRACK(FHDEV(DEV_PTYM_MAJOR, 41)), "/dev/ptym41"},
{"/dev/ptym42", BRACK(FHDEV(DEV_PTYM_MAJOR, 42)), "/dev/ptym42"},
{"/dev/ptym43", BRACK(FHDEV(DEV_PTYM_MAJOR, 43)), "/dev/ptym43"},
{"/dev/ptym44", BRACK(FHDEV(DEV_PTYM_MAJOR, 44)), "/dev/ptym44"},
{"/dev/ptym45", BRACK(FHDEV(DEV_PTYM_MAJOR, 45)), "/dev/ptym45"},
{"/dev/ptym46", BRACK(FHDEV(DEV_PTYM_MAJOR, 46)), "/dev/ptym46"},
{"/dev/ptym47", BRACK(FHDEV(DEV_PTYM_MAJOR, 47)), "/dev/ptym47"},
{"/dev/ptym48", BRACK(FHDEV(DEV_PTYM_MAJOR, 48)), "/dev/ptym48"},
{"/dev/ptym49", BRACK(FHDEV(DEV_PTYM_MAJOR, 49)), "/dev/ptym49"},
{"/dev/ptym50", BRACK(FHDEV(DEV_PTYM_MAJOR, 50)), "/dev/ptym50"},
{"/dev/ptym51", BRACK(FHDEV(DEV_PTYM_MAJOR, 51)), "/dev/ptym51"},
{"/dev/ptym52", BRACK(FHDEV(DEV_PTYM_MAJOR, 52)), "/dev/ptym52"},
{"/dev/ptym53", BRACK(FHDEV(DEV_PTYM_MAJOR, 53)), "/dev/ptym53"},
{"/dev/ptym54", BRACK(FHDEV(DEV_PTYM_MAJOR, 54)), "/dev/ptym54"},
{"/dev/ptym55", BRACK(FHDEV(DEV_PTYM_MAJOR, 55)), "/dev/ptym55"},
{"/dev/ptym56", BRACK(FHDEV(DEV_PTYM_MAJOR, 56)), "/dev/ptym56"},
{"/dev/ptym57", BRACK(FHDEV(DEV_PTYM_MAJOR, 57)), "/dev/ptym57"},
{"/dev/ptym58", BRACK(FHDEV(DEV_PTYM_MAJOR, 58)), "/dev/ptym58"},
{"/dev/ptym59", BRACK(FHDEV(DEV_PTYM_MAJOR, 59)), "/dev/ptym59"},
{"/dev/ptym60", BRACK(FHDEV(DEV_PTYM_MAJOR, 60)), "/dev/ptym60"},
{"/dev/ptym61", BRACK(FHDEV(DEV_PTYM_MAJOR, 61)), "/dev/ptym61"},
{"/dev/ptym62", BRACK(FHDEV(DEV_PTYM_MAJOR, 62)), "/dev/ptym62"},
{"/dev/ptym63", BRACK(FHDEV(DEV_PTYM_MAJOR, 63)), "/dev/ptym63"},
{"/dev/random", BRACK(FH_RANDOM), "/dev/random"},
{"/dev/scd0", BRACK(FHDEV(DEV_CDROM_MAJOR, 0)), "\\Device\\CdRom0"},
{"/dev/scd1", BRACK(FHDEV(DEV_CDROM_MAJOR, 1)), "\\Device\\CdRom1"},
@ -2716,8 +2716,8 @@ static const device dev_storage[] =
const device *cons_dev = dev_storage + 20;
const device *console_dev = dev_storage + 84;
const device *ttym_dev = dev_storage + 303;
const device *ttys_dev = dev_storage + 239;
const device *ptym_dev = dev_storage + 303;
const device *ptys_dev = dev_storage + 239;
const device *urandom_dev = dev_storage + 2641;

View File

@ -33,13 +33,13 @@ enum fh_devices
FH_CONS = FHDEV (DEV_CONS_MAJOR, 0),
FH_CONS_MAX = FHDEV (DEV_CONS_MAJOR, MAX_CONSOLES),
DEV_TTYM_MAJOR = 128,
FH_TTYM = FHDEV (DEV_TTYM_MAJOR, 0),
FH_TTYM_MAX= FHDEV (DEV_TTYM_MAJOR, 255),
DEV_PTYM_MAJOR = 128,
FH_PTYM = FHDEV (DEV_PTYM_MAJOR, 0),
FH_PTYM_MAX= FHDEV (DEV_PTYM_MAJOR, 255),
DEV_TTYS_MAJOR = 136,
FH_TTYS = FHDEV (DEV_TTYS_MAJOR, 0), /* FIXME: Should separate ttys and ptys */
FH_TTYS_MAX= FHDEV (DEV_TTYS_MAJOR, 255), /* FIXME: Should separate ttys and ptys */
DEV_PTYS_MAJOR = 136,
FH_PTYS = FHDEV (DEV_PTYS_MAJOR, 0), /* FIXME: Should separate ttys and ptys */
FH_PTYS_MAX= FHDEV (DEV_PTYS_MAJOR, 255), /* FIXME: Should separate ttys and ptys */
DEV_SERIAL_MAJOR = 117,
FH_SERIAL = FHDEV (117, 0), /* /dev/ttyS? */
@ -317,8 +317,8 @@ struct device
};
extern const device *console_dev;
extern const device *ttym_dev;
extern const device *ttys_dev;
extern const device *ptmx_dev;
extern const device *ptys_dev;
extern const device *urandom_dev;
extern const device dev_dgram_storage;
@ -359,5 +359,5 @@ extern const device dev_fs_storage;
|| (((int) n) == FH_CONIN) \
|| (((int) n) == FH_CONOUT))
#define istty_slave_dev(n) (device::major (n) == DEV_TTYS_MAJOR)
#define istty_slave_dev(n) (device::major (n) == DEV_PTYS_MAJOR)
#endif /*_DEVICES_H*/

View File

@ -66,8 +66,8 @@ const device dev_error_storage =
}
%%
"/dev/tty", BRACK(FH_TTY), "/dev/tty"
"/dev/pty%(0-63)d", BRACK(FHDEV(DEV_TTYS_MAJOR, {$1})), "/dev/pty{$1}", ttys_dev
"/dev/ptym%(0-63)d", BRACK(FHDEV(DEV_TTYM_MAJOR, {$1})), "/dev/ptym{$1}", ttym_dev
"/dev/pty%(0-63)d", BRACK(FHDEV(DEV_PTYS_MAJOR, {$1})), "/dev/pty{$1}", ptys_dev
"/dev/ptym%(0-63)d", BRACK(FHDEV(DEV_PTYM_MAJOR, {$1})), "/dev/ptym{$1}", ptym_dev
"/dev/cons%(0-63)d", BRACK(FHDEV(DEV_CONS_MAJOR, {$1})), "/dev/cons{$1}", cons_dev
"/dev/console", BRACK(FH_CONSOLE), "/dev/console", console_dev
"/dev/ptmx", BRACK(FH_PTMX), "/dev/ptmx"

View File

@ -351,7 +351,7 @@ dtable::init_std_file_from_handle (int fd, HANDLE handle)
/* Console windows are not kernel objects, so the access mask returned
by NtQueryInformationFile is meaningless. CMD always hands down
stdin handles as R/O handles, but our tty slave sides are R/W. */
if (dev == FH_TTY || iscons_dev (dev) || dev.get_major () == DEV_TTYS_MAJOR)
if (dev == FH_TTY || iscons_dev (dev) || dev.get_major () == DEV_PTYS_MAJOR)
access |= GENERIC_READ | GENERIC_WRITE;
else if (NT_SUCCESS (NtQueryInformationFile (handle, &io, &fai,
sizeof fai,
@ -444,10 +444,10 @@ fh_alloc (path_conv& pc)
switch (pc.dev.get_major ())
{
case DEV_TTYS_MAJOR:
case DEV_PTYS_MAJOR:
fh = cnew (fhandler_pty_slave, pc.dev.get_minor ());
break;
case DEV_TTYM_MAJOR:
case DEV_PTYM_MAJOR:
fh = cnew (fhandler_pty_master, pc.dev.get_minor ());
break;
case DEV_CYGDRIVE_MAJOR:
@ -559,10 +559,14 @@ fh_alloc (path_conv& pc)
else if (myself->ctty <= 0
&& !myself->set_ctty (fhandler_termios::last, 0))
/* no tty assigned */;
else if (iscons_dev (myself->ctty))
fh = cnew (fhandler_console, pc.dev);
else
fh = cnew (fhandler_pty_slave, myself->ctty);
{
if (iscons_dev (myself->ctty))
fh = cnew (fhandler_console, pc.dev);
else
fh = cnew (fhandler_pty_slave, myself->ctty);
fh->set_name ("/dev/tty");
}
break;
case FH_KMSG:
fh = cnew (fhandler_mailslot);
@ -600,6 +604,8 @@ build_fh_pc (path_conv& pc, bool set_name)
set_errno (ENXIO);
goto out;
}
else if (fh->get_name ())
/* already got one */;
else if (fh->dev () != FH_NADA)
fh->set_name (fh->dev ().name);
else if (set_name)

View File

@ -469,8 +469,19 @@ fhandler_base::open_with_arch (int flags, mode_t mode)
}
else
{
char *name;
/* Preserve any name (like /dev/tty) derived from build_fh_pc. */
if (!get_name ())
name = NULL;
else
{
name = (char *) alloca (strlen (get_name ()) + 1);
strcpy (name, get_name ());
}
fhandler_base *arch = archetype;
archetype->copyto (this);
if (name)
set_name (name);
archetype = arch;
archetype_usecount (1);
usecount = 0;

View File

@ -1373,7 +1373,7 @@ format_proc_devices (void *, char *&destbuf)
DEV_MEM_MAJOR, DEV_CONS_MAJOR, _major (FH_TTY),
_major (FH_CONSOLE), _major (FH_PTMX),
DEV_TAPE_MAJOR, DEV_MISC_MAJOR, DEV_SOUND_MAJOR,
DEV_SERIAL_MAJOR, DEV_TTYS_MAJOR, DEV_FLOPPY_MAJOR,
DEV_SERIAL_MAJOR, DEV_PTYS_MAJOR, DEV_FLOPPY_MAJOR,
DEV_SD_MAJOR, DEV_CDROM_MAJOR, DEV_SD1_MAJOR,
DEV_SD2_MAJOR, DEV_SD3_MAJOR, DEV_SD4_MAJOR,
DEV_SD5_MAJOR, DEV_SD6_MAJOR, DEV_SD7_MAJOR);

View File

@ -359,7 +359,7 @@ fhandler_pty_slave::fhandler_pty_slave (int unit)
: fhandler_pty_common (), inuse (NULL)
{
if (unit >= 0)
dev ().parse (DEV_TTYS_MAJOR, unit);
dev ().parse (DEV_PTYS_MAJOR, unit);
}
int
@ -953,7 +953,7 @@ fhandler_pty_slave::ioctl (unsigned int cmd, void *arg)
return res;
if (myself->pgid && get_ttyp ()->getpgid () != myself->pgid
&& (unsigned) myself->ctty == FHDEV (DEV_TTYS_MAJOR, get_unit ())
&& (unsigned) myself->ctty == FHDEV (DEV_PTYS_MAJOR, get_unit ())
&& (get_ttyp ()->ti.c_lflag & TOSTOP))
{
/* background process */
@ -1191,9 +1191,13 @@ fhandler_pty_master::fhandler_pty_master (int unit)
dwProcessId (0), need_nl (0)
{
if (unit >= 0)
dev ().parse (DEV_TTYM_MAJOR, unit);
dev ().parse (DEV_PTYM_MAJOR, unit);
else if (!setup ())
dev ().parse (FH_ERROR);
{
dev ().parse (FH_ERROR);
return;
}
set_name ("/dev/ptmx");
}
int
@ -1682,7 +1686,7 @@ fhandler_pty_master::setup ()
t.winsize.ws_row = 25;
t.master_pid = myself->pid;
dev ().parse (DEV_TTYM_MAJOR, unit);
dev ().parse (DEV_PTYM_MAJOR, unit);
termios_printf ("this %p, pty%d opened - from_pty %p, to_pty %p", this, unit,
get_io_handle (), get_output_handle ());

View File

@ -38,7 +38,7 @@ ioctl (int fd, int cmd, ...)
/* FIXME: This stinks. There are collisions between cmd types
depending on whether fd is associated with a pty master or not.
Something to fix for Cygwin2. CGF 2006-06-04 */
if (cfd->is_tty () && cfd->get_major () != DEV_TTYM_MAJOR)
if (cfd->is_tty () && cfd->get_major () != DEV_PTYM_MAJOR)
switch (cmd)
{
case TCGETA:

View File

@ -282,8 +282,12 @@ class path_conv
PWCHAR get_wide_win32_path (PWCHAR wc);
operator DWORD &() {return fileattr;}
operator int () {return fileattr; }
# define cfree_maybe(x) if (x) cfree ((void *) (x))
path_conv &operator =(const path_conv& pc)
{
cfree_maybe (path);
cfree_maybe (normalized_path);
cfree_maybe (wide_path);
memcpy (this, &pc, sizeof pc);
path = cstrdup (pc.path);
conv_handle.dup (pc.conv_handle);
@ -297,11 +301,6 @@ class path_conv
}
return *this;
}
void free_strings ()
{
cfree (modifiable_path ());
cfree ((char *) normalized_path);
}
DWORD get_devn () {return (DWORD) dev;}
short get_unitn () const {return dev.get_minor ();}
DWORD file_attributes () const {return fileattr;}

View File

@ -548,7 +548,7 @@ peek_pipe (select_record *s, bool from_select)
switch (fh->get_major ())
{
case DEV_TTYM_MAJOR:
case DEV_PTYM_MAJOR:
if (((fhandler_pty_master *) fh)->need_nl)
{
gotone = s->read_ready = true;

View File

@ -374,14 +374,13 @@ proc_terminate ()
int i;
for (i = 0; i < nprocs; i++)
{
extern child_info_spawn *chExeced;
/* Don't reset the ppid to 1 if this pid is still going to be
associated with a process.
FIXME: The problem with this simplistic approach is that the
ppid for any surviving children will never be set to 1 in
this scenario. A potential fix would be to move procs into
cygheap but that would complicate startup. What else is new? */
if (!chExeced)
/* FIXME: Resetting the ppid to 1 when this process execs is decidedly
non-UNIXy. We should, at the very least, keep a list of pids
for the exec process to reset when *it* exits. However, avoiding
setting ppid when we are exec'ing causes the ppid to *never* be
set to 1 so we don't do that either.
if (!hExeced)
*/
procs[i]->ppid = 1;
if (procs[i].wait_thread)
{

View File

@ -34,7 +34,7 @@ details. */
#include "winf.h"
#include "ntdll.h"
static suffix_info exe_suffixes[] =
static suffix_info NO_COPY exe_suffixes[] =
{
suffix_info ("", 1),
suffix_info (".exe", 1),
@ -56,7 +56,7 @@ static suffix_info dll_suffixes[] =
};
#endif
child_info_spawn *chExeced;
child_info_spawn NO_COPY *chExeced;
/* Add .exe to PROG if not already present and see if that exists.
If not, return PROG (converted from posix to win32 rules if necessary).

View File

@ -116,7 +116,7 @@ tty_list::init ()
for (int i = 0; i < NTTYS; i++)
{
ttys[i].init ();
ttys[i].setntty (DEV_TTYS_MAJOR, i);
ttys[i].setntty (DEV_PTYS_MAJOR, i);
}
}