tree-wide: use -EINVAL for enum invalid values

As suggested in https://github.com/systemd/systemd/pull/11484#issuecomment-775288617.

This does not touch anything exposed in src/systemd. Changing the defines there
would be a compatibility break.

Note that tests are broken after this commit. They will be fixed in the next one.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2021-02-10 14:46:59 +01:00
parent 71c163c9fa
commit 2d93c20e5f
139 changed files with 255 additions and 245 deletions
+2 -2
View File
@@ -26,7 +26,7 @@ enum UnitFileState {
UNIT_FILE_TRANSIENT,
UNIT_FILE_BAD,
_UNIT_FILE_STATE_MAX,
_UNIT_FILE_STATE_INVALID = -1
_UNIT_FILE_STATE_INVALID = -EINVAL,
};
enum UnitFileScope {
@@ -34,7 +34,7 @@ enum UnitFileScope {
UNIT_FILE_GLOBAL,
UNIT_FILE_USER,
_UNIT_FILE_SCOPE_MAX,
_UNIT_FILE_SCOPE_INVALID = -1
_UNIT_FILE_SCOPE_INVALID = -EINVAL,
};
bool unit_type_may_alias(UnitType type) _const_;