aboutsummaryrefslogtreecommitdiff
path: root/winsup/cygwin/spawn.cc
diff options
context:
space:
mode:
authorTakashi Yano <takashi.yano@nifty.ne.jp>2022-03-10 20:20:00 +0900
committerTakashi Yano <takashi.yano@nifty.ne.jp>2022-03-10 20:38:20 +0900
commitb1743c94e25cd7bb5edbd77f694b1a3e5d90c297 (patch)
tree7f7ade7d501f56a9dadc6d45f9104d4dc9d0fb61 /winsup/cygwin/spawn.cc
parent4ad6b4d4dfed22777a8e7adb97c803bef0553fb0 (diff)
downloadnewlib-b1743c94e25cd7bb5edbd77f694b1a3e5d90c297.zip
newlib-b1743c94e25cd7bb5edbd77f694b1a3e5d90c297.tar.gz
newlib-b1743c94e25cd7bb5edbd77f694b1a3e5d90c297.tar.bz2
Cygwin: console, pty: Fix segfault in child_info_spawn::worker().
- After the commit "Cygwin: pty, console: Fix handle leak which occurs on exec() error.", startxwin cannot start X due to the error "Failed to activate virtual core keyboard: 2". The problem is access violation in the code retrieving the pgid of the ctty. This patch fixes the issue. Addresses: https://cygwin.com/pipermail/cygwin/2022-March/251013.html
Diffstat (limited to 'winsup/cygwin/spawn.cc')
-rw-r--r--winsup/cygwin/spawn.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/winsup/cygwin/spawn.cc b/winsup/cygwin/spawn.cc
index 3b54309..fb3d09d 100644
--- a/winsup/cygwin/spawn.cc
+++ b/winsup/cygwin/spawn.cc
@@ -564,7 +564,7 @@ child_info_spawn::worker (const char *prog_arg, const char *const *argv,
because the Ctrl-C event is sent to all processes in the console, unless
they ignore it explicitely. CREATE_NEW_PROCESS_GROUP does that for us. */
pid_t ctty_pgid =
- ::cygheap->ctty ? ::cygheap->ctty->tc ()->getpgid () : 0;
+ ::cygheap->ctty ? ::cygheap->ctty->tc_getpgid () : 0;
if (!iscygwin () && ctty_pgid && ctty_pgid != myself->pgid)
c_flags |= CREATE_NEW_PROCESS_GROUP;
refresh_cygheap ();