From c692fdb097573c677247ca0fe54706063383806c Mon Sep 17 00:00:00 2001 From: Jamie Cameron Date: Fri, 9 Dec 2011 10:23:50 -0800 Subject: [PATCH] Handle case where there are no disks --- fdisk/fdisk-lib.pl | 1 + 1 file changed, 1 insertion(+) diff --git a/fdisk/fdisk-lib.pl b/fdisk/fdisk-lib.pl index 635509f5a..cbcbe4d8f 100755 --- a/fdisk/fdisk-lib.pl +++ b/fdisk/fdisk-lib.pl @@ -193,6 +193,7 @@ if (open(PARTS, "/proc/partitions")) { @devs = sort { ($b =~ /\/hd[a-z]+$/ ? 1 : 0) <=> ($a =~ /\/hd[a-z]+$/ ? 1 : 0) } @devs; } +return ( ) if (!@devs); # No disks, ie on Xen # Skip cd-rom drive, identified from symlink. Don't do this if we can identify # cds by their media type though