mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-11 05:17:44 +03:00
Merge pull request #5322 from keszybz/silence-gcc-warning
Silence gcc warnings
This commit is contained in:
commit
3b07d037f3
@ -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) {
|
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;
|
int r;
|
||||||
|
|
||||||
assert(m);
|
assert(m);
|
||||||
@ -323,15 +323,15 @@ static int find_unit(Manager *m, sd_bus *bus, const char *path, Unit **unit, sd_
|
|||||||
return r;
|
return r;
|
||||||
|
|
||||||
u = manager_get_unit_by_pid(m, pid);
|
u = manager_get_unit_by_pid(m, pid);
|
||||||
|
if (!u)
|
||||||
|
return 0;
|
||||||
} else {
|
} else {
|
||||||
r = manager_load_unit_from_dbus_path(m, path, error, &u);
|
r = manager_load_unit_from_dbus_path(m, path, error, &u);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
assert(u);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!u)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
*unit = u;
|
*unit = u;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -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) {
|
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;
|
int r;
|
||||||
|
|
||||||
assert(m);
|
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);
|
r = manager_load_unit(m, name, NULL, NULL, &unit);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
return r;
|
return r;
|
||||||
|
assert(unit);
|
||||||
|
|
||||||
return manager_add_job(m, type, unit, mode, e, ret);
|
return manager_add_job(m, type, unit, mode, e, ret);
|
||||||
}
|
}
|
||||||
@ -1481,6 +1482,7 @@ int manager_load_unit_prepare(
|
|||||||
|
|
||||||
assert(m);
|
assert(m);
|
||||||
assert(name || path);
|
assert(name || path);
|
||||||
|
assert(_ret);
|
||||||
|
|
||||||
/* This will prepare the unit for loading, but not actually
|
/* This will prepare the unit for loading, but not actually
|
||||||
* load anything from disk. */
|
* load anything from disk. */
|
||||||
@ -1528,8 +1530,7 @@ int manager_load_unit_prepare(
|
|||||||
unit_add_to_dbus_queue(ret);
|
unit_add_to_dbus_queue(ret);
|
||||||
unit_add_to_gc_queue(ret);
|
unit_add_to_gc_queue(ret);
|
||||||
|
|
||||||
if (_ret)
|
*_ret = ret;
|
||||||
*_ret = ret;
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -1544,6 +1545,7 @@ int manager_load_unit(
|
|||||||
int r;
|
int r;
|
||||||
|
|
||||||
assert(m);
|
assert(m);
|
||||||
|
assert(_ret);
|
||||||
|
|
||||||
/* This will load the service information files, but not actually
|
/* This will load the service information files, but not actually
|
||||||
* start any services or anything. */
|
* start any services or anything. */
|
||||||
@ -1554,8 +1556,7 @@ int manager_load_unit(
|
|||||||
|
|
||||||
manager_dispatch_load_queue(m);
|
manager_dispatch_load_queue(m);
|
||||||
|
|
||||||
if (_ret)
|
*_ret = unit_follow_merge(*_ret);
|
||||||
*_ret = unit_follow_merge(*_ret);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user