From f2bfad59089e1554f7a1342952688f5c2e46c442 Mon Sep 17 00:00:00 2001 From: Liu Xiaodong Date: Wed, 11 Mar 2020 01:30:27 -0400 Subject: [PATCH] scripts/common.sh: print error msg to stderr Error msg in common.sh should be printed into stderr in order to avoid improper usage. For example: If env has no lspci and pciconf, then function iter_all_pci_class_code will return the error msg back, every word in error msg will be used by caller wrongly. Change-Id: I6a875e49527539ba82bd331c8878e972e26cbc39 Signed-off-by: Liu Xiaodong Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/1227 Tested-by: SPDK CI Jenkins Reviewed-by: Changpeng Liu Reviewed-by: Ben Walker Reviewed-by: Shuhei Matsumoto Reviewed-by: Aleksey Marchuk --- scripts/common.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/common.sh b/scripts/common.sh index 7948d68e8..5e3829998 100644 --- a/scripts/common.sh +++ b/scripts/common.sh @@ -53,7 +53,7 @@ function iter_all_pci_class_code() { cut -d$'\t' -f1 | sed -e 's/^[a-zA-Z0-9_]*@pci//g' | tr ':' ' ')) printf "%04x:%02x:%02x:%x\n" ${addr[0]} ${addr[1]} ${addr[2]} ${addr[3]} else - echo "Missing PCI enumeration utility" + echo "Missing PCI enumeration utility" >&2 exit 1 fi } @@ -73,7 +73,7 @@ function iter_all_pci_dev_id() { cut -d$'\t' -f1 | sed -e 's/^[a-zA-Z0-9_]*@pci//g' | tr ':' ' ')) printf "%04x:%02x:%02x:%x\n" ${addr[0]} ${addr[1]} ${addr[2]} ${addr[3]} else - echo "Missing PCI enumeration utility" + echo "Missing PCI enumeration utility" >&2 exit 1 fi }