shared: use -EINVAL for _UNIT_FILE_CHANGE_TYPE_INVALID

Follow-up of #11484
This commit is contained in:
Benjamin Robin
2021-02-16 23:35:25 +01:00
parent 9de42a6a5f
commit c1b48a7f5b
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -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;
}
+1 -1
View File
@@ -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 {