summaryrefslogtreecommitdiffstats
path: root/src/core/swap.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/swap.h
parentudev: make sure UdevBuiltinCommand is properly converted (diff)
downloadsystemd-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/core/swap.h')
-rw-r--r--src/core/swap.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/swap.h b/src/core/swap.h
index 6ce9bfd9b4..c0e3f118e1 100644
--- a/src/core/swap.h
+++ b/src/core/swap.h
@@ -14,7 +14,7 @@ typedef enum SwapExecCommand {
SWAP_EXEC_ACTIVATE,
SWAP_EXEC_DEACTIVATE,
_SWAP_EXEC_COMMAND_MAX,
- _SWAP_EXEC_COMMAND_INVALID = -1
+ _SWAP_EXEC_COMMAND_INVALID = -EINVAL,
} SwapExecCommand;
typedef enum SwapResult {
@@ -26,7 +26,7 @@ typedef enum SwapResult {
SWAP_FAILURE_CORE_DUMP,
SWAP_FAILURE_START_LIMIT_HIT,
_SWAP_RESULT_MAX,
- _SWAP_RESULT_INVALID = -1
+ _SWAP_RESULT_INVALID = -EINVAL,
} SwapResult;
typedef struct SwapParameters {