[iwhd patch 2/2] error to stderr

Pete Zaitcev zaitcev at redhat.com
Thu Nov 18 00:30:23 UTC 2010


This is useless in production, since backend.c dups the same pipe to both
stderr and stdout. However it is marginally uselful in debugging if they
are redirected by a developer.

OK, I admit it: this feels more "correct".

---
 dc-register-image |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

commit 964d6744f7825cec2ec6bf808cb4083d6c288c28
Author: Pete Zaitcev <zaitcev at yahoo.com>
Date:   Wed Nov 17 17:22:18 2010 -0700

    Diag to fd 2.

diff --git a/dc-register-image b/dc-register-image
index 6225e08..3192f32 100755
--- a/dc-register-image
+++ b/dc-register-image
@@ -46,23 +46,23 @@ if [ "$ramdisk" != "_default_" ]; then
 fi
 $ECHO ec2-bundle-image -i $bucket/$object -d $tmpdir $bundle_args
 if [ $? != 0 ]; then
-	echo "ERROR bundling_failed"
-	echo ec2-bundle-image -i $bucket/$object -d $tmpdir $bundle_args
+	echo "ERROR bundling_failed" >&2
+	echo ec2-bundle-image -i $bucket/$object -d $tmpdir $bundle_args >&2
 	exit 1
 fi
 
 upload_args="--batch --retry -b $ami_bkt -a $api_key -s $api_secret"
 $ECHO ec2-upload-bundle -m $tmpdir/$object.manifest.xml $upload_args
 if [ $? != 0 ]; then
-	echo "ERROR uploading_failed"
-	echo ec2-upload-bundle -m $tmpdir/$object.manifest.xml $upload_args
+	echo "ERROR uploading_failed" >&2
+	echo ec2-upload-bundle -m $tmpdir/$object.manifest.xml $upload_args >&2
 	exit 1
 fi
 
 register_args="-C $cert_file -K $key_file"
 $ECHO ec2-register $register_args $ami_bkt/$object.manifest.xml -n $object
 if [ $? != 0 ]; then
-	echo "ERROR registration_failed"
-	echo ec2-register $register_args $ami_bkt/$object.manifest.xml -n $object
+	echo "ERROR registration_failed" >&2
+	echo ec2-register $register_args $ami_bkt/$object.manifest.xml -n $object >&2
 	exit 1
 fi


More information about the iwhd-devel mailing list