From bc371b28067b3230674f605fc4734ce93759b4f2 Mon Sep 17 00:00:00 2001 From: Anton Gubarkov Date: Wed, 25 Aug 2021 23:01:26 +0300 Subject: [PATCH] vdev_id: Return an error if config file is not found Signed-off-by: Anton Gubarkov Reviewed-by: Tony Hutter Reviewed-by: Brian Behlendorf --- cmd/vdev_id/vdev_id | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cmd/vdev_id/vdev_id b/cmd/vdev_id/vdev_id index d349ba43ca..cad59c93f0 100755 --- a/cmd/vdev_id/vdev_id +++ b/cmd/vdev_id/vdev_id @@ -140,7 +140,8 @@ Usage: vdev_id [-h] -p number of phy's per switch port [default=$PHYS_PER_PORT] -h show this summary EOF - exit 0 + exit 1 + # exit with error to avoid processing usage message by a udev rule } map_slot() { @@ -728,7 +729,7 @@ done if [ ! -r "$CONFIG" ] ; then echo "Error: Config file \"$CONFIG\" not found" - exit 0 + exit 1 fi if [ -z "$DEV" ] && [ -z "$ENCLOSURE_MODE" ] ; then