1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-03-08 20:58:20 +03:00

core: some more structured initialization

This commit is contained in:
Lennart Poettering 2020-05-26 14:31:34 +02:00
parent 4c42543429
commit b0cea477d4

View File

@ -447,14 +447,17 @@ static int service_add_fd_store(Service *s, int fd, const char *name, bool do_po
}
}
fs = new0(ServiceFDStore, 1);
fs = new(ServiceFDStore, 1);
if (!fs)
return -ENOMEM;
fs->fd = fd;
fs->service = s;
fs->do_poll = do_poll;
fs->fdname = strdup(name ?: "stored");
*fs = (ServiceFDStore) {
.fd = fd,
.service = s,
.do_poll = do_poll,
.fdname = strdup(name ?: "stored"),
};
if (!fs->fdname) {
free(fs);
return -ENOMEM;