summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2006-03-10 00:59:45 +0000
committerMike Frysinger <vapier@gentoo.org>2006-03-10 00:59:45 +0000
commit30a6de2584c573c1d14621a586c20e331b8f5586 (patch)
tree4f7d5a77e851e443668836777fc3896539745260 /sys-apps/hdparm/files
parentMark 2.6 stable on ia64 (diff)
downloadgentoo-2-30a6de2584c573c1d14621a586c20e331b8f5586.tar.gz
gentoo-2-30a6de2584c573c1d14621a586c20e331b8f5586.tar.bz2
gentoo-2-30a6de2584c573c1d14621a586c20e331b8f5586.zip
fix up device test some more based upon Matthias Foerste's work #104683
(Portage version: 2.1_pre5-r4)
Diffstat (limited to 'sys-apps/hdparm/files')
-rw-r--r--sys-apps/hdparm/files/hdparm-init-76
1 files changed, 4 insertions, 2 deletions
diff --git a/sys-apps/hdparm/files/hdparm-init-7 b/sys-apps/hdparm/files/hdparm-init-7
index 56263f074fc2..231d42021d47 100644
--- a/sys-apps/hdparm/files/hdparm-init-7
+++ b/sys-apps/hdparm/files/hdparm-init-7
@@ -116,8 +116,10 @@ start() {
do
# check that the block device really exists
# by opening it for reading
- local errmsg=$( : 2>/dev/null <$device )
- if [[ -b $device ]] && [[ $? == 0 || $(errmsg) == "*: No medium found" ]]
+ local errmsg status
+ errmsg=$(: 2>&1 <$device)
+ status=$?
+ if [[ -b $device ]] && [[ ${status} == 0 || ${errmsg} == *": No medium found" ]]
then
eval args=\${`basename $device`_args}
do_hdparm