diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2017-02-12 12:40:09 -0500 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2017-02-12 12:40:09 -0500 |
commit | 7a6a095a9ef6ec014a23a231e5d11e8a2ef0fe17 (patch) | |
tree | 6f3ddeae1e19416b395f6db88ae02040138d5421 /src/core | |
parent | 6818c54ca6663c008fad77d2677c61758c7215f5 (diff) |
core/manager: make manager_load_unit*() functions always take output arg
We were inconsistent, manager_load_unit_prepare() would crash if _ret was ever NULL.
But none of the callers use NULL. So simplify things and require it to be non-NULL.
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/manager.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/core/manager.c b/src/core/manager.c index e4da945777..0f8f808b4a 100644 --- a/src/core/manager.c +++ b/src/core/manager.c @@ -1481,6 +1481,7 @@ int manager_load_unit_prepare( assert(m); assert(name || path); + assert(_ret); /* This will prepare the unit for loading, but not actually * load anything from disk. */ @@ -1528,8 +1529,7 @@ int manager_load_unit_prepare( unit_add_to_dbus_queue(ret); unit_add_to_gc_queue(ret); - if (_ret) - *_ret = ret; + *_ret = ret; return 0; } @@ -1544,6 +1544,7 @@ int manager_load_unit( int r; assert(m); + assert(_ret); /* This will load the service information files, but not actually * start any services or anything. */ @@ -1554,8 +1555,7 @@ int manager_load_unit( manager_dispatch_load_queue(m); - if (_ret) - *_ret = unit_follow_merge(*_ret); + *_ret = unit_follow_merge(*_ret); return 0; } |