X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fbus-driverd%2Fbus-driverd.c;h=f8a123d4f118d290ae73005648c435f503d5ac35;hb=215c7625dd510759290d45d6c46434e4338843ec;hp=d6dec5dc2a7e85c5f4943ffcb03a3a36fd8875d9;hpb=98531b5762778ed5740e8e7edc4e3790e57e9f37;p=elogind.git diff --git a/src/bus-driverd/bus-driverd.c b/src/bus-driverd/bus-driverd.c index d6dec5dc2..f8a123d4f 100644 --- 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); - 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); - else + } else 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) { - 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; } @@ -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 -EIO; + return sd_bus_error_setf(error, SD_BUS_ERROR_SERVICE_UNKNOWN, "Bus name %s not found.", name); 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) { - log_error("Unable to request name: %s\n", strerror(-r)); + log_error("Unable to request name: %s", strerror(-r)); return r; }