aboutsummaryrefslogtreecommitdiffstats
path: root/etc/zfs/zfs-functions.in
diff options
context:
space:
mode:
authorнаб <[email protected]>2021-05-14 11:55:17 +0200
committerBrian Behlendorf <[email protected]>2021-06-08 14:45:03 -0700
commit59d91b4d10bac7597cb21394080b3f33b84e184a (patch)
treecb36445604228978f12ca96ec3607bb86eea8006 /etc/zfs/zfs-functions.in
parentd53a6969c106cc06a8064dabc3161364e7e04ba9 (diff)
Fix SC2181 ("[ $?") outside tests/
Reviewed-by: John Kennedy <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #12042
Diffstat (limited to 'etc/zfs/zfs-functions.in')
-rw-r--r--etc/zfs/zfs-functions.in12
1 files changed, 7 insertions, 5 deletions
diff --git a/etc/zfs/zfs-functions.in b/etc/zfs/zfs-functions.in
index 54f2ebc0e..dbe131732 100644
--- a/etc/zfs/zfs-functions.in
+++ b/etc/zfs/zfs-functions.in
@@ -182,15 +182,17 @@ zfs_daemon_stop()
# LSB functions
start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 \
--pidfile "$PIDFILE" --name "$DAEMON_NAME"
- [ "$?" = 0 ] && rm -f "$PIDFILE"
+ ret="$?"
+ [ "$ret" = 0 ] && rm -f "$PIDFILE"
- return $?
+ return "$ret"
elif type killproc > /dev/null 2>&1 ; then
# Fedora/RedHat functions
killproc -p "$PIDFILE" "$DAEMON_NAME"
- [ "$?" = 0 ] && rm -f "$PIDFILE"
+ ret="$?"
+ [ "$ret" = 0 ] && rm -f "$PIDFILE"
- return $?
+ return "$ret"
else
# Unsupported
return 3
@@ -371,7 +373,7 @@ in_mtab()
local mntpnt="$1"
# Remove 'unwanted' characters.
mntpnt=$(printf '%b\n' "$mntpnt" | sed -e 's,/,,g' \
- -e 's,-,,g' -e 's,\.,,g' -e 's, ,,g')
+ -e 's,-,,g' -e 's,\.,,g' -e 's, ,,g')
local var
var="$(eval echo MTAB_$mntpnt)"