diff options
author | Lennart Poettering <lennart@poettering.net> | 2022-10-14 11:11:53 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2022-10-14 11:40:40 +0200 |
commit | f8662fee2fac735385dc060f1435e4af5327138d (patch) | |
tree | f2d3c0599cc6fcd7bb095d38921be106ed593031 /src/shared/bus-unit-util.c | |
parent | update TODO (diff) | |
download | systemd-f8662fee2fac735385dc060f1435e4af5327138d.tar.xz systemd-f8662fee2fac735385dc060f1435e4af5327138d.zip |
install: make InstallChange enum type a proper type
We can just make this an enum, as long as we ensure it has enough range,
which we can do by adding -ERRNO_MAX as one possible value (at least on
GNU C). We already do that at multiple other places, so let's do this
here too.
Diffstat (limited to 'src/shared/bus-unit-util.c')
-rw-r--r-- | src/shared/bus-unit-util.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/shared/bus-unit-util.c b/src/shared/bus-unit-util.c index 2962126b0f..b850a28e85 100644 --- a/src/shared/bus-unit-util.c +++ b/src/shared/bus-unit-util.c @@ -2682,16 +2682,18 @@ int bus_deserialize_and_dump_unit_file_changes(sd_bus_message *m, bool quiet, In return bus_log_parse_error(r); while ((r = sd_bus_message_read(m, "(sss)", &type, &path, &source)) > 0) { - /* We expect only "success" changes to be sent over the bus. - Hence, reject anything negative. */ - int ch = install_change_from_string(type); - if (ch < 0) { - log_notice_errno(ch, "Manager reported unknown change type \"%s\" for path \"%s\", ignoring.", + InstallChangeType t; + + /* We expect only "success" changes to be sent over the bus. Hence, reject anything + * negative. */ + t = install_change_type_from_string(type); + if (t < 0) { + log_notice_errno(t, "Manager reported unknown change type \"%s\" for path \"%s\", ignoring.", type, path); continue; } - r = install_changes_add(changes, n_changes, ch, path, source); + r = install_changes_add(changes, n_changes, t, path, source); if (r < 0) return r; } |