Module Name:    src
Committed By:   apb
Date:           Tue Nov  8 19:11:19 UTC 2011

Modified Files:
        src/etc: MAKEDEV.tmpl

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.145 -r1.146 src/etc/MAKEDEV.tmpl

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/etc/MAKEDEV.tmpl
diff -u src/etc/MAKEDEV.tmpl:1.145 src/etc/MAKEDEV.tmpl:1.146
--- src/etc/MAKEDEV.tmpl:1.145	Wed Oct 26 09:02:20 2011
+++ src/etc/MAKEDEV.tmpl	Tue Nov  8 19:11:19 2011
@@ -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 @@ nooutput()
 	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

Reply via email to