mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-11 05:17:44 +03:00
sysv: use structured initialization
This commit is contained in:
parent
c8aa4b5b86
commit
470ab28d07
@ -788,19 +788,21 @@ static int enumerate_sysv(const LookupPaths *lp, Hashmap *all_services) {
|
||||
if (!fpath)
|
||||
return log_oom();
|
||||
|
||||
service = new0(SysvStub, 1);
|
||||
service = new(SysvStub, 1);
|
||||
if (!service)
|
||||
return log_oom();
|
||||
|
||||
service->sysv_start_priority = -1;
|
||||
service->name = TAKE_PTR(name);
|
||||
service->path = TAKE_PTR(fpath);
|
||||
*service = (SysvStub) {
|
||||
.sysv_start_priority = -1,
|
||||
.name = TAKE_PTR(name),
|
||||
.path = TAKE_PTR(fpath),
|
||||
};
|
||||
|
||||
r = hashmap_put(all_services, service->name, service);
|
||||
if (r < 0)
|
||||
return log_oom();
|
||||
|
||||
service = NULL;
|
||||
TAKE_PTR(service);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user