summaryrefslogtreecommitdiff
path: root/src/libsystemd/sd-device/device-enumerator.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2015-05-20 23:34:12 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2015-05-20 23:44:46 -0400
commit53fae771bcf1623cd28791c48fa60d9d5e5086e4 (patch)
tree0b87572f171a502eca76c97c73334861f27b08ab /src/libsystemd/sd-device/device-enumerator.c
parent925fbb9f80a8263216ee9f2fe9ab5c8d02651bb7 (diff)
sd-device: fix return codes on error
asprintf() does not set errno.
Diffstat (limited to 'src/libsystemd/sd-device/device-enumerator.c')
-rw-r--r--src/libsystemd/sd-device/device-enumerator.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libsystemd/sd-device/device-enumerator.c b/src/libsystemd/sd-device/device-enumerator.c
index 4de36d54e1..ce4862d7f0 100644
--- a/src/libsystemd/sd-device/device-enumerator.c
+++ b/src/libsystemd/sd-device/device-enumerator.c
@@ -764,9 +764,9 @@ static int parent_crawl_children(sd_device_enumerator *enumerator, const char *p
if (dent->d_type != DT_DIR)
continue;
- k = asprintf(&child, "%s/%s", path, dent->d_name);
- if (k < 0)
- return -errno;
+ child = strjoin(path, "/", dent->d_name, NULL);
+ if (!child)
+ return -ENOMEM;
k = parent_add_child(enumerator, child);
if (k < 0)