]> err.no Git - systemd/commitdiff
[PATCH] small ide-devfs.sh fix
authormd@Linux.IT <md@Linux.IT>
Sat, 27 Mar 2004 09:21:41 +0000 (01:21 -0800)
committerGreg KH <gregkh@suse.de>
Wed, 27 Apr 2005 04:35:12 +0000 (21:35 -0700)
The file may not exist and errors would be spewed on the console.

extras/ide-devfs.sh

index e5bf177f8b2909fb8a95c1418965b340d5d98f8d..22d09d7a5ac0efc8768504b9b874325c8d4f05db 100644 (file)
@@ -35,7 +35,7 @@ get_dev_number() {
        echo $((${num} - 1))
 }
 
-if [ -z "$3" ]; then
+if [ -z "$3" -a -f /proc/ide/${1}/media ]; then
        MEDIA=`cat /proc/ide/${1}/media`
        if [ "${MEDIA}" = "cdrom" ]; then
                echo ide/host${HOST}/bus${BUS}/target${TARGET}/lun0/cd cdroms/cdrom`get_dev_number $1 cdrom`