summaryrefslogtreecommitdiff
path: root/src/core/manager.h
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2021-02-09 17:17:47 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2021-02-10 14:46:59 +0100
commit2d93c20e5f600a9f1e4b617123577acf6ce5faa0 (patch)
tree9c1e17edb84c37920bb37d0fb8021c058c4ca2b3 /src/core/manager.h
parent71c163c9fa737053bccf8f6d733b272dfacc966f (diff)
downloadsystemd-2d93c20e5f600a9f1e4b617123577acf6ce5faa0.tar.gz
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.
Diffstat (limited to 'src/core/manager.h')
-rw-r--r--src/core/manager.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/core/manager.h b/src/core/manager.h
index e56d297908..cbd8018f04 100644
--- a/src/core/manager.h
+++ b/src/core/manager.h
@@ -36,7 +36,7 @@ typedef enum ManagerState {
MANAGER_MAINTENANCE,
MANAGER_STOPPING,
_MANAGER_STATE_MAX,
- _MANAGER_STATE_INVALID = -1
+ _MANAGER_STATE_INVALID = -EINVAL,
} ManagerState;
typedef enum ManagerObjective {
@@ -50,7 +50,7 @@ typedef enum ManagerObjective {
MANAGER_KEXEC,
MANAGER_SWITCH_ROOT,
_MANAGER_OBJECTIVE_MAX,
- _MANAGER_OBJECTIVE_INVALID = -1
+ _MANAGER_OBJECTIVE_INVALID = -EINVAL,
} ManagerObjective;
typedef enum StatusType {
@@ -65,7 +65,7 @@ typedef enum OOMPolicy {
OOM_STOP, /* The kernel kills the process it wants to kill, and we stop the unit */
OOM_KILL, /* The kernel kills the process it wants to kill, and all others in the unit, and we stop the unit */
_OOM_POLICY_MAX,
- _OOM_POLICY_INVALID = -1
+ _OOM_POLICY_INVALID = -EINVAL,
} OOMPolicy;
/* Notes:
@@ -111,7 +111,7 @@ typedef enum ManagerTimestamp {
MANAGER_TIMESTAMP_INITRD_UNITS_LOAD_START,
MANAGER_TIMESTAMP_INITRD_UNITS_LOAD_FINISH,
_MANAGER_TIMESTAMP_MAX,
- _MANAGER_TIMESTAMP_INVALID = -1,
+ _MANAGER_TIMESTAMP_INVALID = -EINVAL,
} ManagerTimestamp;
typedef enum WatchdogType {