From 552607ffeda7b1d2a2fee97f0bf53a0c7b4e4a7e Mon Sep 17 00:00:00 2001 From: Andreas Thienemann Date: May 26 2009 20:30:58 +0000 Subject: - Added patch from upstream git to not close stdout on err. This improves initramfs use of dash. --- diff --git a/dash-do-not-close-stderr.patch b/dash-do-not-close-stderr.patch new file mode 100644 index 0000000..c00f164 --- /dev/null +++ b/dash-do-not-close-stderr.patch @@ -0,0 +1,27 @@ +commit fcc4134a7b76d82d39dea635c41ec593a41d6d19 +Author: Herbert Xu +Date: Sun Feb 22 19:29:48 2009 +0800 + + [JOBS] Do not close stderr when /dev/tty fails to open + + As it stands if we fail to open /dev/tty we end up closing stderr + after saving it at a higher fd. + + Thanks to David van Gorkom for reporting this. + + Signed-off-by: Herbert Xu + +diff --git a/src/jobs.c b/src/jobs.c +index 69a84f7..b1ab7ab 100644 +--- a/src/jobs.c ++++ b/src/jobs.c +@@ -195,6 +195,9 @@ setjobctl(int on) + while (!isatty(fd)) + if (--fd < 0) + goto out; ++ fd = dup(fd); ++ if (fd < 0) ++ goto out; + } + fd = savefd(fd); + do { /* while we are in the background */ diff --git a/dash.spec b/dash.spec index 6f73afa..2de9085 100644 --- a/dash.spec +++ b/dash.spec @@ -1,12 +1,13 @@ Name: dash Version: 0.5.4 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Small and fast POSIX-compliant shell Group: System Environment/Shells License: BSD URL: http://gondor.apana.org.au/~herbert/dash/ Source0: http://gondor.apana.org.au/~herbert/dash/files/dash-%{version}.tar.gz +Patch0: dash-do-not-close-stderr.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) %description @@ -16,6 +17,7 @@ significantly faster than bash (the GNU Bourne-Again SHell) for most tasks. %prep %setup -q +%patch0 -p 1 %build %configure @@ -38,6 +40,10 @@ rm -rf $RPM_BUILD_ROOT %{_datadir}/man/man1/dash.1.gz %changelog +* Tue May 26 2009 Andreas Thienemann 0.5.4-4 +- Added patch from upstream git to not close stdout on err. This improves + initramfs use of dash. + * Fri Feb 08 2008 Warren Togami 0.5.4-3 - rebuild for gcc-4.3