summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-05-16 04:30:45 +0200
committerLennart Poettering <lennart@poettering.net>2010-05-16 04:30:45 +0200
commit413d6313d82ef4f50a4186cfadd8a6b1e4e65164 (patch)
treea7cdf4e46ced6d844acd77accc43e865c6b14e31
parentdd28669fc734941fffbba233ed69243a36daa0ac (diff)
manager: don't dispatch load queue if we don't have to
-rw-r--r--manager.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/manager.c b/manager.c
index 89b210d6a3..81af07b000 100644
--- a/manager.c
+++ b/manager.c
@@ -1563,7 +1563,7 @@ int manager_load_unit_prepare(Manager *m, const char *name, const char *path, Un
if ((ret = manager_get_unit(m, name))) {
*_ret = ret;
- return 0;
+ return 1;
}
if (!(ret = unit_new(m)))
@@ -1590,7 +1590,6 @@ int manager_load_unit_prepare(Manager *m, const char *name, const char *path, Un
}
int manager_load_unit(Manager *m, const char *name, const char *path, Unit **_ret) {
- Unit *ret;
int r;
assert(m);
@@ -1598,13 +1597,13 @@ int manager_load_unit(Manager *m, const char *name, const char *path, Unit **_re
/* This will load the service information files, but not actually
* start any services or anything. */
- if ((r = manager_load_unit_prepare(m, name, path, &ret)) < 0)
+ if ((r = manager_load_unit_prepare(m, name, path, _ret)) != 0)
return r;
manager_dispatch_load_queue(m);
if (_ret)
- *_ret = unit_follow_merge(ret);
+ *_ret = unit_follow_merge(*_ret);
return 0;
}