aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/vdev_id
diff options
context:
space:
mode:
authorNed Bass <[email protected]>2014-12-17 11:01:42 -0800
committerBrian Behlendorf <[email protected]>2014-12-19 12:05:16 -0800
commit2d9d57b0fbe17b56a1bdd09505400144778cb189 (patch)
treea42e270a445a7e59779f6596d7216d37dee24c48 /cmd/vdev_id
parent5c7afad448325b5761601f574fc937476d3a77d1 (diff)
vdev_id: use mawk-compatible regular expression
Slot mapping in vdev_id doesn't work on systems using mawk as the 'awk' alternative. A regular expression in map_slot() contains an unquoted empty string following the alternation (|) operator, which results in an "missing operand" error with mawk. The solution is to rearrange the expression so the alternation has two operands. Signed-off-by: Ned Bass <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes zfsonlinux/pkg-zfs#136 Closes zfsonlinux/zfs#2965
Diffstat (limited to 'cmd/vdev_id')
-rwxr-xr-xcmd/vdev_id/vdev_id2
1 files changed, 1 insertions, 1 deletions
diff --git a/cmd/vdev_id/vdev_id b/cmd/vdev_id/vdev_id
index b6752ba1b..6fddd12f3 100755
--- a/cmd/vdev_id/vdev_id
+++ b/cmd/vdev_id/vdev_id
@@ -116,7 +116,7 @@ map_slot() {
local MAPPED_SLOT=
MAPPED_SLOT=`awk "\\$1 == \"slot\" && \\$2 == ${LINUX_SLOT} && \
- \\$4 ~ /^(${CHANNEL}|)$/ { print \\$3; exit }" $CONFIG`
+ \\$4 ~ /^${CHANNEL}$|^$/ { print \\$3; exit }" $CONFIG`
if [ -z "$MAPPED_SLOT" ] ; then
MAPPED_SLOT=$LINUX_SLOT
fi