From 0d46b4d25c6545be831e045c61da62bf7b7fdaee Mon Sep 17 00:00:00 2001 From: Fredrik Fornwall Date: Sun, 7 Feb 2016 19:33:15 -0500 Subject: [PATCH] gdb: Fix "setpgrp failed in child" error This broke e.g. Ctrl+C behaviour when debugging programs under gdb. Fixes #73. --- packages/gdb/build.sh | 2 +- packages/gdb/gdb-inflow.c.patch | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 packages/gdb/gdb-inflow.c.patch diff --git a/packages/gdb/build.sh b/packages/gdb/build.sh index 82023ff06..2ec4db60c 100755 --- a/packages/gdb/build.sh +++ b/packages/gdb/build.sh @@ -2,7 +2,7 @@ TERMUX_PKG_HOMEPAGE=https://www.gnu.org/software/gdb/ TERMUX_PKG_DESCRIPTION="The standard GNU Debugger that runs on many Unix-like systems and works for many programming languages" TERMUX_PKG_DEPENDS="liblzma, libexpat, readline" TERMUX_PKG_VERSION=7.10.1 -TERMUX_PKG_BUILD_REVISION=1 +TERMUX_PKG_BUILD_REVISION=2 TERMUX_PKG_SRCURL=http://ftp.gnu.org/gnu/gdb/gdb-${TERMUX_PKG_VERSION}.tar.xz # gdb can not build with our normal --disable-static: https://sourceware.org/bugzilla/show_bug.cgi?id=15916 TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--with-system-readline --with-curses --enable-static ac_cv_func_getpwent=no ac_cv_func_getpwnam=no" diff --git a/packages/gdb/gdb-inflow.c.patch b/packages/gdb/gdb-inflow.c.patch new file mode 100644 index 000000000..4d9d8ebad --- /dev/null +++ b/packages/gdb/gdb-inflow.c.patch @@ -0,0 +1,18 @@ +diff -u -r ../gdb-7.10.1/gdb/inflow.c ./gdb/inflow.c +--- ../gdb-7.10.1/gdb/inflow.c 2015-12-05 10:16:45.000000000 -0500 ++++ ./gdb/inflow.c 2016-02-07 19:28:38.979181296 -0500 +@@ -862,10 +862,10 @@ + { + #if defined (HAVE_TERMIOS) || defined (TIOCGPGRP) + #ifdef HAVE_SETPGID +- /* The call setpgid (0, 0) is supposed to work and mean the same +- thing as this, but on Ultrix 4.2A it fails with EPERM (and +- setpgid (getpid (), getpid ()) succeeds). */ +- retval = setpgid (getpid (), getpid ()); ++ /* Termux change: setpgid(getpid(), getpid()), which is used upstream ++ for working around Ultrix 4.2A issue, does not work on Android but ++ fails with ESRCH. So revert back to simple setpgid(0,0). */ ++ retval = setpgid (0, 0); + #else + #ifdef HAVE_SETPGRP + #ifdef SETPGRP_VOID