Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 'omp-jb51105' into 'master'
[busybox] Restore IO in ash after using ^C on job. Fixes JB#51105

See merge request mer-core/busybox!30
  • Loading branch information
Matti Kosola committed Oct 30, 2020
2 parents b6038e6 + 6a8dd41 commit b1e90a7
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 1 deletion.
@@ -0,0 +1,49 @@
From 73514579b4bb1668b17075440dfaa2f882a79c96 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Bidar?= <bjorn.bidar@jolla.com>
Date: Fri, 30 Oct 2020 12:18:01 +0200
Subject: [PATCH] ash: job: option to restore term io after job is
stopped/killed
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This moves the restore IOS support into a build option so it can be
disabled/enabled. Using this fixes lost terminal stdout after using ^C
on programs like /bin/su.

Signed-off-by: Björn Bidar <bjorn.bidar@jolla.com>
---
shell/ash.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/shell/ash.c b/shell/ash.c
index ecb9b132b..97bf55994 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -77,6 +77,14 @@
//config: default y
//config: depends on SHELL_ASH
//config:
+//config:config ASH_JOB_RESTORE_TERM_IOS
+//config: bool "Restore termio"
+//config: default y
+//config: depends on ASH || SH_IS_ASH || BASH_IS_ASH
+//config: help
+//config: Restore IO after foreground job received SIGINT/SIGKILL/SIGSTOP.
+//config: Avoids lost STDOUT after programs like su recieves ^C.
+//config:
//config:config ASH_ALIAS
//config: bool "Alias support"
//config: default y
@@ -3796,7 +3804,7 @@ static unsigned njobs; //4
/* current job */
static struct job *curjob; //lots

-#if 0
+#if ENABLE_ASH_JOB_RESTORE_TERM_IOS
/* Bash has a feature: it restores termios after a successful wait for
* a foreground job which had at least one stopped or sigkilled member.
* The probable rationale is that SIGSTOP and SIGKILL can preclude task from
--
2.29.1

2 changes: 1 addition & 1 deletion rpm/busybox.spec
Expand Up @@ -12,6 +12,7 @@ Patch0: 0001-Copy-extended-attributes-if-p-flag-is-provided-to-cp.patch
Patch1: 0002-applets-Busybox-in-usr-bin-instead-of-bin.patch
Patch2: 0003-applets-watch-in-usr-bin.patch
Patch3: 0001-ash-Load-ENV-file-also-if-SSH_CLIENT-SSH2_CLIENT-is-.patch
Patch4: 0001-ash-job-option-to-restore-term-io-after-job-is-stopp.patch
URL: https://git.sailfishos.org/mer-core/busybox
BuildRequires: glibc-static
BuildRequires: libselinux-static libsepol-static
Expand Down Expand Up @@ -293,7 +294,6 @@ cat >> busybox.links << EOF
EOF

%install
rm -rf %{buildroot}
mkdir -p %{buildroot}/bin
mkdir -p %{buildroot}/usr/bin
install -m 755 busybox %{buildroot}/usr/bin/busybox
Expand Down

0 comments on commit b1e90a7

Please sign in to comment.