From c1b48a7f5bd95c3fc30e6b1b2a1e67becc5e5c53 Mon Sep 17 00:00:00 2001 From: Benjamin Robin Date: Tue, 16 Feb 2021 23:21:07 +0100 Subject: shared: use -EINVAL for _UNIT_FILE_CHANGE_TYPE_INVALID Follow-up of #11484 --- src/shared/bus-unit-util.c | 4 ++-- src/shared/install.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/shared/bus-unit-util.c b/src/shared/bus-unit-util.c index 2ce507aa1c..61d264b953 100644 --- a/src/shared/bus-unit-util.c +++ b/src/shared/bus-unit-util.c @@ -2389,9 +2389,9 @@ int bus_deserialize_and_dump_unit_file_changes(sd_bus_message *m, bool quiet, Un /* 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); + log_notice_errno(ch, "Manager reported unknown change type \"%s\" for path \"%s\", ignoring.", + type, path); continue; } diff --git a/src/shared/install.h b/src/shared/install.h index 7d7a2c9f27..232184de33 100644 --- a/src/shared/install.h +++ b/src/shared/install.h @@ -31,7 +31,7 @@ enum UnitFileChangeType { UNIT_FILE_IS_MASKED, UNIT_FILE_IS_DANGLING, _UNIT_FILE_CHANGE_TYPE_MAX, - _UNIT_FILE_CHANGE_TYPE_INVALID = INT_MIN + _UNIT_FILE_CHANGE_TYPE_INVALID = -EINVAL, }; enum UnitFileFlags { -- cgit v1.2.3