summaryrefslogtreecommitdiff
path: root/src/core/dbus.c
diff options
context:
space:
mode:
authorMartin Pitt <martinpitt@users.noreply.github.com>2017-02-13 08:58:57 +0100
committerGitHub <noreply@github.com>2017-02-13 08:58:57 +0100
commit3b07d037f316196f05cc3d2d2812a3e8401a4c06 (patch)
tree3d8bd0fa3ed5b5cb653308f2c9f668d981488fae /src/core/dbus.c
parent01c901e257521a7a3ff6fc5945a3e5a4a7409a94 (diff)
parenta8cfb1b3949de54bd6fb6c04125053e702579b5c (diff)
Merge pull request #5322 from keszybz/silence-gcc-warning
Silence gcc warnings
Diffstat (limited to 'src/core/dbus.c')
-rw-r--r--src/core/dbus.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/core/dbus.c b/src/core/dbus.c
index 0493e5786c..065f2d81d6 100644
--- a/src/core/dbus.c
+++ b/src/core/dbus.c
@@ -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;
}