summaryrefslogtreecommitdiffstats
path: root/devices
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2007-04-05 13:59:29 +1000
committerJeremy Kerr <jk@ozlabs.org>2007-04-05 13:59:29 +1000
commit6ce15c4265d3813ee311756ec03c6e4da74c1dbd (patch)
treee48edfee41d4fda0983c132a9c933c19f5ed40e0 /devices
parentc26b2a1d05865bc92e795797e5d0535edd2aca77 (diff)
downloadtalos-petitboot-6ce15c4265d3813ee311756ec03c6e4da74c1dbd.tar.gz
talos-petitboot-6ce15c4265d3813ee311756ec03c6e4da74c1dbd.zip
Don't crash when ID_BUS isn't in the env.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'devices')
-rw-r--r--devices/udev-helper.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/devices/udev-helper.c b/devices/udev-helper.c
index 1db8a26..6a9a42b 100644
--- a/devices/udev-helper.c
+++ b/devices/udev-helper.c
@@ -372,6 +372,8 @@ enum generic_icon_type guess_device_type(void)
const char *bus = getenv("ID_BUS");
if (type && streq(type, "cd"))
return ICON_TYPE_OPTICAL;
+ if (!bus)
+ return ICON_TYPE_UNKNOWN;
if (streq(bus, "usb"))
return ICON_TYPE_USB;
if (streq(bus, "ata") || streq(bus, "scsi"))
OpenPOWER on IntegriCloud