]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
scripts: mkemmc.sh: Fix output pollution on missing images
authorJan Kiszka <jan.kiszka@siemens.com>
Wed, 15 Apr 2026 05:46:06 +0000 (07:46 +0200)
committerPhilippe Mathieu-Daudé <philmd@linaro.org>
Tue, 12 May 2026 05:03:09 +0000 (07:03 +0200)
Reorder the redirections so that the 2>/dev/null can actually take
effect.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Jerome Forissier <jerome.forissier@arm.com>
Message-ID: <b9d603b7396719f38e03cd969a4ac1b48f5ea96a.1776231967.git.jan.kiszka@siemens.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
scripts/mkemmc.sh

index 429388213c6fa40f5f03aba2423d97d013e2dca2..3d8546cdaa628eb0e8620bc1c1b29c5009d1f23c 100755 (executable)
@@ -40,7 +40,7 @@ process_size() {
     alignment=$3
     image_arg=$4
     if [ "${image_arg#*:}" = "$image_arg"  ]; then
-        if ! size=$(wc -c < "$image_file" 2>/dev/null); then
+        if ! size=$(wc -c 2>/dev/null < "$image_file"); then
             echo "Missing $name image '$image_file'." >&2
             exit 1
         fi
@@ -102,7 +102,7 @@ check_truncation() {
     if [ "$image_file" = "/dev/zero" ]; then
         return
     fi
-    if ! actual_size=$(wc -c < "$image_file" 2>/dev/null); then
+    if ! actual_size=$(wc -c 2>/dev/null < "$image_file"); then
         echo "Missing image '$image_file'." >&2
         exit 1
     fi