X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fshared%2Fbus-util.c;h=0ab5755068251ed1fb8592e92c22c398434918fa;hp=4e9bc512c8b43f32aa6683a582ec6f74af93292d;hb=b95d5ee7e9a86cd3cd93ae2be366ddc64299f043;hpb=6eed9ed454fb055f6e283858af01ffbb18c991fd diff --git a/src/shared/bus-util.c b/src/shared/bus-util.c index 4e9bc512c..0ab575506 100644 --- a/src/shared/bus-util.c +++ b/src/shared/bus-util.c @@ -1072,7 +1072,7 @@ static int map_basic(sd_bus *bus, const char *member, sd_bus_message *m, sd_bus_ } case SD_BUS_TYPE_UINT32: { - uint64_t u; + uint32_t u; uint32_t *p = userdata; r = sd_bus_message_read_basic(m, type, &u); @@ -2043,7 +2043,7 @@ static const struct { static void log_job_error_with_service_result(const char* service, const char *result, const char* const* extra_args) { _cleanup_free_ char *service_shell_quoted = NULL; - const char *systemctl = "systemctl", *journalctl = "journalct"; + const char *systemctl = "systemctl", *journalctl = "journalctl"; assert(service); @@ -2053,8 +2053,8 @@ static void log_job_error_with_service_result(const char* service, const char *r _cleanup_free_ char *t; t = strv_join((char**) extra_args, " "); - systemctl = strjoina("systemctl ", t ?: "", NULL); - journalctl = strjoina("journalctl ", t ?: "", NULL); + systemctl = strjoina("systemctl ", t ? : ""); + journalctl = strjoina("journalctl ", t ? : ""); } if (!isempty(result)) { @@ -2203,14 +2203,16 @@ int bus_deserialize_and_dump_unit_file_changes(sd_bus_message *m, bool quiet, Un return bus_log_parse_error(r); while ((r = sd_bus_message_read(m, "(sss)", &type, &path, &source)) > 0) { - if (!quiet) { - if (streq(type, "symlink")) - log_info("Created symlink from %s to %s.", path, source); - else - log_info("Removed symlink %s.", path); + /* We expect only "success" changes to be sent over the bus. + Hence, reject anything negative. */ + UnitFileChangeType ch = unit_file_change_type_from_string(type); + + if (ch < 0) { + log_notice("Manager reported unknown change type \"%s\" for path \"%s\", ignoring.", type, path); + continue; } - r = unit_file_changes_add(changes, n_changes, streq(type, "symlink") ? UNIT_FILE_SYMLINK : UNIT_FILE_UNLINK, path, source); + r = unit_file_changes_add(changes, n_changes, ch, path, source); if (r < 0) return r; } @@ -2221,6 +2223,7 @@ int bus_deserialize_and_dump_unit_file_changes(sd_bus_message *m, bool quiet, Un if (r < 0) return bus_log_parse_error(r); + unit_file_dump_changes(0, NULL, *changes, *n_changes, false); return 0; }