1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-12-23 17:34:00 +03:00

Merge pull request #5322 from keszybz/silence-gcc-warning

Silence gcc warnings
This commit is contained in:
Martin Pitt 2017-02-13 08:58:57 +01:00 committed by GitHub
commit 3b07d037f3
2 changed files with 10 additions and 9 deletions

View File

@ -298,7 +298,7 @@ static int bus_job_find(sd_bus *bus, const char *path, const char *interface, vo
}
static int find_unit(Manager *m, sd_bus *bus, const char *path, Unit **unit, sd_bus_error *error) {
Unit *u;
Unit *u = NULL; /* just to appease gcc, initialization is not really necessary */
int r;
assert(m);
@ -323,15 +323,15 @@ static int find_unit(Manager *m, sd_bus *bus, const char *path, Unit **unit, sd_
return r;
u = manager_get_unit_by_pid(m, pid);
if (!u)
return 0;
} else {
r = manager_load_unit_from_dbus_path(m, path, error, &u);
if (r < 0)
return 0;
assert(u);
}
if (!u)
return 0;
*unit = u;
return 1;
}

View File

@ -1398,7 +1398,7 @@ tr_abort:
}
int manager_add_job_by_name(Manager *m, JobType type, const char *name, JobMode mode, sd_bus_error *e, Job **ret) {
Unit *unit;
Unit *unit = NULL; /* just to appease gcc, initialization is not really necessary */
int r;
assert(m);
@ -1409,6 +1409,7 @@ int manager_add_job_by_name(Manager *m, JobType type, const char *name, JobMode
r = manager_load_unit(m, name, NULL, NULL, &unit);
if (r < 0)
return r;
assert(unit);
return manager_add_job(m, type, unit, mode, e, ret);
}
@ -1481,6 +1482,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 +1530,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 +1545,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 +1556,7 @@ int manager_load_unit(
manager_dispatch_load_queue(m);
if (_ret)
*_ret = unit_follow_merge(*_ret);
*_ret = unit_follow_merge(*_ret);
return 0;
}