Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/etc In the nooutput function, don't mess with file descritor 4



details:   https://anonhg.NetBSD.org/src/rev/688fd8b1352b
branches:  trunk
changeset: 771090:688fd8b1352b
user:      apb <apb%NetBSD.org@localhost>
date:      Tue Nov 08 19:11:19 2011 +0000

description:
In the nooutput function, don't mess with file descritor 4
at the outer level; do it inside a subshell context so as not
to interfere with a different use of fd 4 by the caller.

This should fix PR 45590.

diffstat:

 etc/MAKEDEV.tmpl |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (19 lines):

diff -r 012132f08276 -r 688fd8b1352b etc/MAKEDEV.tmpl
--- a/etc/MAKEDEV.tmpl  Tue Nov 08 18:37:31 2011 +0000
+++ b/etc/MAKEDEV.tmpl  Tue Nov 08 19:11:19 2011 +0000
@@ -1,5 +1,5 @@
 #!/bin/sh -
-#      $NetBSD: MAKEDEV.tmpl,v 1.145 2011/10/26 09:02:20 apb Exp $
+#      $NetBSD: MAKEDEV.tmpl,v 1.146 2011/11/08 19:11:19 apb Exp $
 #
 # Copyright (c) 2003,2007,2008 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -382,7 +382,7 @@
        local junk
        case "$flags" in
        "-1")   junk="$( "$@" )" ;;
-       "-2")   exec 4>&1 ; junk="$( { "$@" ; } 2>&1 1>&4 )" ; exec 4>&- ;;
+       "-2")   junk="$( exec 4>&1 ; { "$@" ; } 2>&1 1>&4 )" ;;
        "-12")  junk="$( { "$@" ; } 2>&1 )" ;;
        *)      warn "Incorrect use of nooutput" ;;
        esac



Home | Main Index | Thread Index | Old Index