Merge pull request #12407 from keszybz/two-unrelated-cleanups

Two unrelated cleanups
This commit is contained in:
Lennart Poettering 2019-04-26 23:43:27 +02:00 committed by GitHub
commit d8974757c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 9 deletions

View File

@ -403,15 +403,12 @@ int cgroup_add_device_allow(CGroupContext *c, const char *dev, const char *mode)
assert(u); \
\
c = unit_get_cgroup_context(u); \
\
if (c->entry##_set) \
if (c && c->entry##_set) \
return c->entry; \
\
while (UNIT_ISSET(u->slice)) { \
u = UNIT_DEREF(u->slice); \
while ((u = UNIT_DEREF(u->slice))) { \
c = unit_get_cgroup_context(u); \
\
if (c->default_##entry##_set) \
if (c && c->default_##entry##_set) \
return c->default_##entry; \
} \
\

View File

@ -3365,7 +3365,7 @@ static int link_initialized_and_synced(Link *link) {
/* We may get called either from the asynchronous netlink callback,
* or directly for link_add() if running in a container. See link_add(). */
if (!IN_SET(link->state, LINK_STATE_PENDING, LINK_STATE_INITIALIZED))
return 1;
return 0;
log_link_debug(link, "Link state is up-to-date");
link_set_state(link, LINK_STATE_INITIALIZED);
@ -3383,7 +3383,7 @@ static int link_initialized_and_synced(Link *link) {
&link->mac, &network);
if (r == -ENOENT) {
link_enter_unmanaged(link);
return 1;
return 0;
} else if (r == 0 && network->unmanaged) {
link_enter_unmanaged(link);
return 0;
@ -3420,7 +3420,7 @@ static int link_initialized_and_synced(Link *link) {
if (r < 0)
return r;
return 1;
return 0;
}
static int link_initialized_handler(sd_netlink *rtnl, sd_netlink_message *m, Link *link) {