This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Fix a couple problems with mkconfig.sh


Some versions of rm don't like being run with no standard output.
cmp was making noise.

Applied as obvious bugfix.

zw

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

===================================================================
Index: mkconfig.sh
--- mkconfig.sh	2001/03/22 18:48:30	1.2
+++ mkconfig.sh	2001/03/23 01:13:50
@@ -12,8 +12,11 @@ fi
 
 output=$1
 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.
 # This substitutes for lots of *.h files.
 if [ "$TARGET_CPU_DEFAULT" != "" ]; then
@@ -53,10 +56,10 @@ echo "#include \"insn-codes.h\""
 echo "#include \"insn-flags.h\""
 echo "#endif"
 
-exec >&-
+) > $output.T
 
 # 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
     rm -f $output.T
 else


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]