]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
shared: use -EINVAL for _UNIT_FILE_CHANGE_TYPE_INVALID
authorBenjamin Robin <dev@benjarobin.fr>
Tue, 16 Feb 2021 22:21:07 +0000 (23:21 +0100)
committerBenjamin Robin <dev@benjarobin.fr>
Tue, 16 Feb 2021 22:35:25 +0000 (23:35 +0100)
Follow-up of #11484

src/shared/bus-unit-util.c
src/shared/install.h

index 2ce507aa1ce67a9a794cec5b8b783cffd708bedf..61d264b9537aac7946d23879e6bc145b3b0743d7 100644 (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;
                 }
 
index 7d7a2c9f273b047ee82b26d0cca12f3209bdb6a8..232184de33b29e7e7dc48fb659de8b4b70bea7ca 100644 (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 {