From: Benjamin Robin Date: Tue, 16 Feb 2021 22:21:07 +0000 (+0100) Subject: shared: use -EINVAL for _UNIT_FILE_CHANGE_TYPE_INVALID X-Git-Tag: v248-rc1~88^2~6 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c1b48a7f5bd95c3fc30e6b1b2a1e67becc5e5c53;p=thirdparty%2Fsystemd.git shared: use -EINVAL for _UNIT_FILE_CHANGE_TYPE_INVALID Follow-up of #11484 --- diff --git a/src/shared/bus-unit-util.c b/src/shared/bus-unit-util.c index 2ce507aa1ce..61d264b9537 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 7d7a2c9f273..232184de33b 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 {