blob: 0f2acb27d12b665630596e2f07646859afd36188 [file] [log] [blame]
--- laptop-mode-tools-1.59/usr/share/laptop-mode-tools/modules/hdparm
+++ laptop-mode-tools-1.59/usr/share/laptop-mode-tools/modules/hdparm.new
@@ -17,6 +17,11 @@
local MEDIA=
local BUS=
+ # Make sure the drive exists before checking anything.
+ if [ ! -e $1 ]; then
+ return 1
+ fi
+
# If we are running udev, this is the most portable way
# It assumes more or less recent udev (> 070)
if [ $HAVE_UDEVINFO -ne 0 ] ; then