diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2021-02-09 17:17:47 +0100 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2021-02-10 14:46:59 +0100 |
commit | 2d93c20e5f600a9f1e4b617123577acf6ce5faa0 (patch) | |
tree | 9c1e17edb84c37920bb37d0fb8021c058c4ca2b3 /src/machine | |
parent | udev: make sure UdevBuiltinCommand is properly converted (diff) | |
download | systemd-2d93c20e5f600a9f1e4b617123577acf6ce5faa0.tar.xz systemd-2d93c20e5f600a9f1e4b617123577acf6ce5faa0.zip |
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/machine')
-rw-r--r-- | src/machine/machine.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/machine/machine.h b/src/machine/machine.h index 2f627157a3..5e0e529567 100644 --- a/src/machine/machine.h +++ b/src/machine/machine.h @@ -14,7 +14,7 @@ typedef enum MachineState { MACHINE_RUNNING, /* Machine is running */ MACHINE_CLOSING, /* Machine is terminating */ _MACHINE_STATE_MAX, - _MACHINE_STATE_INVALID = -1 + _MACHINE_STATE_INVALID = -EINVAL, } MachineState; typedef enum MachineClass { @@ -22,14 +22,14 @@ typedef enum MachineClass { MACHINE_VM, MACHINE_HOST, _MACHINE_CLASS_MAX, - _MACHINE_CLASS_INVALID = -1 + _MACHINE_CLASS_INVALID = -EINVAL, } MachineClass; enum KillWho { KILL_LEADER, KILL_ALL, _KILL_WHO_MAX, - _KILL_WHO_INVALID = -1 + _KILL_WHO_INVALID = -EINVAL, }; struct Machine { |