The return value ("$?") is always the status of the last command in
the pipe.
Signed-off-by: Sun Ke <sunke32@huawei.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
_require_scratch_nocheck
_require_command "$KILLALL_PROG" killall
-_scratch_mkfs | _filter_mkfs > /dev/null 2> $tmp.mkfs || _fail "mkfs failed"
+_scratch_mkfs | _filter_mkfs > /dev/null 2> $tmp.mkfs
+test "${PIPESTATUS[0]}" -eq 0 || _fail "mkfs failed"
. $tmp.mkfs # import agcount
rm -f "$seqres.full"
# Format and mount
-_scratch_mkfs | _filter_mkfs > $seqres.full 2> $tmp.mkfs || _fail "mkfs failed"
+_scratch_mkfs | _filter_mkfs > $seqres.full 2> $tmp.mkfs
+test "${PIPESTATUS[0]}" -eq 0 || _fail "mkfs failed"
_scratch_mount
# Get directory block size