diff options
author | Thomas Hindoe Paaboel Andersen <phomes@gmail.com> | 2015-05-06 18:37:06 +0200 |
---|---|---|
committer | Thomas Hindoe Paaboel Andersen <phomes@gmail.com> | 2015-05-06 18:40:30 +0200 |
commit | c0c6a4fc1c843fc61d44dc9f0a2b14c01201db12 (patch) | |
tree | 01ab6321993bcc848f6990d99c49d957d262d3ac | |
parent | c4fcf70a015e47ec894e1b9d0c1940caf652195b (diff) | |
download | systemd-c0c6a4fc1c843fc61d44dc9f0a2b14c01201db12.tar.gz systemd-c0c6a4fc1c843fc61d44dc9f0a2b14c01201db12.tar.bz2 systemd-c0c6a4fc1c843fc61d44dc9f0a2b14c01201db12.zip |
test-libudev: add error handling
CID#1296244
-rw-r--r-- | src/test/test-libudev.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/test/test-libudev.c b/src/test/test-libudev.c index 2b004fdfb1..6bc77cf899 100644 --- a/src/test/test-libudev.c +++ b/src/test/test-libudev.c @@ -304,6 +304,7 @@ static int test_queue(struct udev *udev) { static int test_enumerate(struct udev *udev, const char *subsystem) { struct udev_enumerate *udev_enumerate; + int r; printf("enumerate '%s'\n", subsystem == NULL ? "<all>" : subsystem); udev_enumerate = udev_enumerate_new(udev); @@ -339,7 +340,9 @@ static int test_enumerate(struct udev *udev, const char *subsystem) { if (udev_enumerate == NULL) return -1; udev_enumerate_add_match_subsystem(udev_enumerate,"block"); - udev_enumerate_add_match_is_initialized(udev_enumerate); + r = udev_enumerate_add_match_is_initialized(udev_enumerate); + if (r < 0) + return r; udev_enumerate_scan_devices(udev_enumerate); test_enumerate_print_list(udev_enumerate); udev_enumerate_unref(udev_enumerate); |