Fix readlink usage
authorBryn M. Reeves <bmr@redhat.com>
Tue, 22 Jan 2013 17:48:31 +0000 (17:48 +0000)
committerBryn M. Reeves <bmr@redhat.com>
Tue, 22 Jan 2013 17:48:31 +0000 (17:48 +0000)
Always use the BA_READLINK variable to invoke readlink.

blkdevalias

index 818cf37..7f4341f 100755 (executable)
@@ -389,7 +389,7 @@ ba_deletedisk () {
     echo -n "Removing wwid map disk \"$_ALIAS\":"
     # generate device path for refresh call
     _DEVPATH="/dev/$BA_DEV_PATH/${WWIDMAP[$_WWID]}"
-    _TARGET=$(readlink -f $_DEVPATH)
+    _TARGET=$($BA_READLINK -f $_DEVPATH)
     ba_del_wwid_mapping $_WWID \
     && if [ "$BA_DEBUG" != "yes" ]; then
         echo "                                  [  OK  ]"
@@ -405,7 +405,7 @@ ba_list_disks () {
         local _DEVPATH
         _DEVPATH="/dev/$BA_DEV_PATH/${WWIDMAP[${NAMEMAP[$_D]}]}"
         echo -n $_D " $_DEVPATH -> "
-        echo $(readlink $_DEVPATH)
+        echo $($BA_READLINK $_DEVPATH)
     done | sort -V
 }
 
@@ -425,7 +425,7 @@ ba_querydisk () {
     _debug "ba_querydisk: ALIAS=\"$_ALIAS\"" \
         "WWID=\"$_WWID\" LISTDEV=\"$_LISTDEV\""
     if [ "$_LISTDEV" == "1" ]; then
-        DEV="/dev/$BA_DEV_PATH/$(readlink "/dev/$BA_DEV_PATH/$_ALIAS")"
+        DEV="/dev/$BA_DEV_PATH/$($BA_READLINK "/dev/$BA_DEV_PATH/$_ALIAS")"
         MAJ="$[0x$(stat --format "%t" $DEV)]"
         MIN="$[0x$(stat --format "%T" $DEV)]"
         _ONDEV="on device [$MAJ,$MIN]"
@@ -447,7 +447,7 @@ ba_scandisks () {
     fi
     _debug "ba_scandisks: device refresh requested: $_REFRESH"
     for _DEV in /dev/$BA_DEV_PATH/*; do
-        _TARGET=$(readlink $_DEV)
+        _TARGET=$($BA_READLINK $_DEV)
         # perform refresh on pre-canonicalised device path
         if [ "$_REFRESH" == "yes" ]; then
             _debug "ba_scandisks: refreshing device at $_TARGET"