summaryrefslogtreecommitdiffstats
path: root/src/udev/udev-builtin-hwdb.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2018-10-22 05:04:52 +0200
committerYu Watanabe <watanabe.yu+github@gmail.com>2018-10-23 11:28:38 +0200
commit269c3b67c626b252763f0fa3228a98003e85d88f (patch)
tree2561ad1aa02d6f22ceab96d08c944b9eb8b79b73 /src/udev/udev-builtin-hwdb.c
parentudev: logs error in udev_builtin_add_property() (diff)
downloadsystemd-269c3b67c626b252763f0fa3228a98003e85d88f.tar.xz
systemd-269c3b67c626b252763f0fa3228a98003e85d88f.zip
udev: propagate original error from udev_builtin_add_property()
Diffstat (limited to 'src/udev/udev-builtin-hwdb.c')
-rw-r--r--src/udev/udev-builtin-hwdb.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/udev/udev-builtin-hwdb.c b/src/udev/udev-builtin-hwdb.c
index 59ac25110c..5a905c3b66 100644
--- a/src/udev/udev-builtin-hwdb.c
+++ b/src/udev/udev-builtin-hwdb.c
@@ -21,7 +21,7 @@ int udev_builtin_hwdb_lookup(sd_device *dev,
const char *filter, bool test) {
_cleanup_free_ char *lookup = NULL;
const char *key, *value;
- int n = 0;
+ int n = 0, r;
if (!hwdb)
return -ENOENT;
@@ -37,8 +37,9 @@ int udev_builtin_hwdb_lookup(sd_device *dev,
if (filter && fnmatch(filter, key, FNM_NOESCAPE) != 0)
continue;
- if (udev_builtin_add_property(dev, test, key, value) < 0)
- return -ENOMEM;
+ r = udev_builtin_add_property(dev, test, key, value);
+ if (r < 0)
+ return r;
n++;
}
return n;