Commit 1b0ae0f9 by Zack Weinberg Committed by Zack Weinberg

mkconfig.sh: Use a subshell with redirected stdout...

	* mkconfig.sh: Use a subshell with redirected stdout,
	instead of closing stdout and confusing commands that run
	afterward.  Throw away output of cmp.

From-SVN: r40765
parent b937498e
2001-03-22 Zack Weinberg <zackw@stanford.edu>
* mkconfig.sh: Use a subshell with redirected stdout,
instead of closing stdout and confusing commands that run
afterward. Throw away output of cmp.
2001-03-22 Gordon Sadler <gbsadler1@lcisp.com> 2001-03-22 Gordon Sadler <gbsadler1@lcisp.com>
* Makefile.in (stage1_build): Pass CFLAGS to stage1_build. * Makefile.in (stage1_build): Pass CFLAGS to stage1_build.
......
...@@ -12,7 +12,10 @@ fi ...@@ -12,7 +12,10 @@ fi
output=$1 output=$1
rm -f $output.T rm -f $output.T
exec > $output.T
# We used to exec > $output.T but apparently this has bugs.
# Use a redirected subshell instead.
(
# Define TARGET_CPU_DEFAULT if the system wants one. # Define TARGET_CPU_DEFAULT if the system wants one.
# This substitutes for lots of *.h files. # This substitutes for lots of *.h files.
...@@ -53,10 +56,10 @@ echo "#include \"insn-codes.h\"" ...@@ -53,10 +56,10 @@ echo "#include \"insn-codes.h\""
echo "#include \"insn-flags.h\"" echo "#include \"insn-flags.h\""
echo "#endif" echo "#endif"
exec >&- ) > $output.T
# Avoid changing the actual file if possible. # Avoid changing the actual file if possible.
if [ -f $output ] && cmp $output.T $output; then if [ -f $output ] && cmp $output.T $output >/dev/null 2>&1; then
echo $output is unchanged >&2 echo $output is unchanged >&2
rm -f $output.T rm -f $output.T
else else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment