common/rc: fix _repair_scratch_fs error reporting
authorAmir Goldstein <amir73il@gmail.com>
Tue, 28 May 2019 12:08:47 +0000 (15:08 +0300)
committerEryu Guan <guaneryu@gmail.com>
Sun, 2 Jun 2019 05:47:07 +0000 (13:47 +0800)
_dump_err2() helper was introduced over two years ago and it broke
the error reporting from _repair_scratch_fs.

Every test that runs:
_repair_scratch_fs >> $seqres.full

and expect to fail if anything is written to stderr is not working
as intended.

Reported-by: zhangyi (F) <yi.zhang@huawei.com>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: zhangyi (F) <yi.zhang@huawei.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
common/rc

index 17b89d5d8519471ebaf2089401a923d877e924e5..e78e09201c32f15203dcf3b5eae88e09d5717b31 100644 (file)
--- a/common/rc
+++ b/common/rc
@@ -98,7 +98,7 @@ _dump_err_cont()
 _dump_err2()
 {
     _err_msg="$*"
 _dump_err2()
 {
     _err_msg="$*"
-    >2& echo "$_err_msg"
+    >&2 echo "$_err_msg"
 }
 
 _log_err()
 }
 
 _log_err()