mkinitrd unification across distributions
 help / color / mirror / Atom feed
* [PATCH 8/8] Close original fd after bash-generated high redirection.
@ 2011-08-31  4:41 John Reiser
  0 siblings, 0 replies; only message in thread
From: John Reiser @ 2011-08-31  4:41 UTC (permalink / raw)
  To: initramfs-u79uwXL29TY76Z2rM5mHXA

---
 dracut           |    3 ++-
 dracut-functions |    2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/dracut b/dracut
index d42f258..c46244f 100755
--- a/dracut
+++ b/dracut
@@ -616,7 +616,8 @@ if [[ $kernel_only != yes ]]; then
 fi
  # bash sets cpio_stdin to a new fd >= 10.  See REDIRECTION in bash manpage.
-)  {cpio_stdin}>&1  |  cpio -pdmu "${initdir}"
+# Pipe that new fd as stdin into cpio, and ignore the old stdout of subshell.
+)  {cpio_stdin}>&1  1>&-  |  cpio -pdmu --quiet "${initdir}"
  if (($maxloglvl >= 5)); then
     ddebug "Listing sizes of included files:"
diff --git a/dracut-functions b/dracut-functions
index 8109699..1942bf9 100755
--- a/dracut-functions
+++ b/dracut-functions
@@ -959,7 +959,7 @@ instmods() {
     # Capture all stderr from modprobe onto a new fd $modprobe_stderr,
     # and pipe it into egrep.  See REDIRECTION in bash manpage.
     export modprobe_stderr
-    ( instmods_1 "$@" ) {modprobe_stderr}>&1 \
+    ( instmods_1 "$@" ) {modprobe_stderr}>&1  1>&- \
     | egrep -v 'FATAL: Module .* not found.' | derror
     return $?
 }
-- 
1.7.6


-- 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2011-08-31  4:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-31  4:41 [PATCH 8/8] Close original fd after bash-generated high redirection John Reiser

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox