From 911a4828e054a531be961cea34de89b666bda710 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 1 Aug 2011 01:28:01 +0200 Subject: util: introduce join() to speed up simple string concatenations --- src/load-dropin.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/load-dropin.c') diff --git a/src/load-dropin.c b/src/load-dropin.c index d30865cbc5..984a47a297 100644 --- a/src/load-dropin.c +++ b/src/load-dropin.c @@ -78,7 +78,8 @@ static int process_dir(Unit *u, const char *unit_path, const char *name, const c assert(name); assert(suffix); - if (asprintf(&path, "%s/%s%s", unit_path, name, suffix) < 0) + path = join(unit_path, "/", name, suffix, NULL); + if (!path) return -ENOMEM; if (u->meta.manager->unit_path_cache && -- cgit v1.2.3-54-g00ecf