From 3df635050b4068089d5477b9423de06c6a39bdee Mon Sep 17 00:00:00 2001 From: Tom Gundersen Date: Mon, 20 Jul 2015 09:25:52 -0400 Subject: sd-device: get_subsystem - don't complain if a device does not have a subsystem Signed-off-by: Anthony G. Basile --- src/libudev/libudev-device.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/libudev') diff --git a/src/libudev/libudev-device.c b/src/libudev/libudev-device.c index ed9964ac44..1cfcbe10b6 100644 --- a/src/libudev/libudev-device.c +++ b/src/libudev/libudev-device.c @@ -722,7 +722,8 @@ static struct udev_device *udev_device_new(struct udev *udev) if (udev == NULL) { errno = EINVAL; return NULL; - } + } else if (!subsystem) + errno = ENODATA; udev_device = new0(struct udev_device, 1); if (udev_device == NULL) { -- cgit v1.2.3-54-g00ecf