File check-for-temporary-file-before-d.patch of Package sg3_utils.1394

From: Hannes Reinecke <hare@suse.de>
Date: Tue, 24 Feb 2015 09:17:09 +0100
Subject: rescan-scsi-bus.sh: Check for temporary file before deleting

If the temporary file doesn't exist rescan-scsi-bus.sh would
accidentally remove /dev/null instead.

References: bsc#917049
---
 scripts/rescan-scsi-bus.sh |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/scripts/rescan-scsi-bus.sh
+++ b/scripts/rescan-scsi-bus.sh
@@ -722,7 +722,7 @@ findremapped()
       incrchgd "$hctl"
     fi
   done < $tmpfile
-  rm $tmpfile 2&>1 /dev/null
+  [ -f $tmpfile ] && rm $tmpfile
 
   if test -n "$mp_enable" -a -n "$mpaths" ; then
     echo "Updating multipath device mappings"
openSUSE Build Service is sponsored by