chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
bus: driverd: don't attempt to remove from empty list
[elogind.git]
/
src
/
bus-driverd
/
bus-driverd.c
diff --git
a/src/bus-driverd/bus-driverd.c
b/src/bus-driverd/bus-driverd.c
index d6dec5dc2a7e85c5f4943ffcb03a3a36fd8875d9..f8a123d4f118d290ae73005648c435f503d5ac35 100644
(file)
--- a/
src/bus-driverd/bus-driverd.c
+++ b/
src/bus-driverd/bus-driverd.c
@@
-90,10
+90,10
@@
static void match_free(Match *m) {
Match *first;
first = hashmap_get(m->client->matches, m->match);
Match *first;
first = hashmap_get(m->client->matches, m->match);
- LIST_REMOVE(matches, first, m);
- if (first)
+ if (first) {
+ LIST_REMOVE(matches, first, m);
assert_se(hashmap_replace(m->client->matches, m->match, first) >= 0);
assert_se(hashmap_replace(m->client->matches, m->match, first) >= 0);
- else
+
}
else
hashmap_remove(m->client->matches, m->match);
m->client->n_matches--;
hashmap_remove(m->client->matches, m->match);
m->client->n_matches--;
@@
-346,7
+346,7
@@
static int driver_remove_match(sd_bus *bus, sd_bus_message *message, void *userd
m = hashmap_get(c->matches, normalized);
if (!m) {
m = hashmap_get(c->matches, normalized);
if (!m) {
- r = sd_bus_error_setf(error, SD_BUS_ERROR_MATCH_RULE_NOT_FOUND, "Match rule \"%s\" not found.");
+ r = sd_bus_error_setf(error, SD_BUS_ERROR_MATCH_RULE_NOT_FOUND, "Match rule \"%s\" not found."
, normalized
);
goto finish;
}
goto finish;
}
@@
-695,7
+695,7
@@
static int driver_start_service_by_name(sd_bus *bus, sd_bus_message *m, void *us
return r;
if (!t || !t[0] || t[1])
return r;
if (!t || !t[0] || t[1])
- return
-EIO
;
+ return
sd_bus_error_setf(error, SD_BUS_ERROR_SERVICE_UNKNOWN, "Bus name %s not found.", name)
;
r = sd_bus_call_method(
bus,
r = sd_bus_call_method(
bus,
@@
-767,7
+767,7
@@
static int connect_bus(Context *c) {
r = sd_bus_request_name(c->bus, "org.freedesktop.DBus", 0);
if (r < 0) {
r = sd_bus_request_name(c->bus, "org.freedesktop.DBus", 0);
if (r < 0) {
- log_error("Unable to request name: %s
\n
", strerror(-r));
+ log_error("Unable to request name: %s", strerror(-r));
return r;
}
return r;
}