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/core/service.h | |
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/core/service.h')
-rw-r--r-- | src/core/service.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/core/service.h b/src/core/service.h index 11c3d3f370..af474aa40e 100644 --- a/src/core/service.h +++ b/src/core/service.h @@ -20,7 +20,7 @@ typedef enum ServiceRestart { SERVICE_RESTART_ON_ABORT, SERVICE_RESTART_ALWAYS, _SERVICE_RESTART_MAX, - _SERVICE_RESTART_INVALID = -1 + _SERVICE_RESTART_INVALID = -EINVAL, } ServiceRestart; typedef enum ServiceType { @@ -32,7 +32,7 @@ typedef enum ServiceType { SERVICE_IDLE, /* much like simple, but delay exec() until all jobs are dispatched. */ SERVICE_EXEC, /* we fork and wait until we execute exec() (this means our own setup is waited for) */ _SERVICE_TYPE_MAX, - _SERVICE_TYPE_INVALID = -1 + _SERVICE_TYPE_INVALID = -EINVAL, } ServiceType; typedef enum ServiceExecCommand { @@ -44,7 +44,7 @@ typedef enum ServiceExecCommand { SERVICE_EXEC_STOP, SERVICE_EXEC_STOP_POST, _SERVICE_EXEC_COMMAND_MAX, - _SERVICE_EXEC_COMMAND_INVALID = -1 + _SERVICE_EXEC_COMMAND_INVALID = -EINVAL, } ServiceExecCommand; typedef enum NotifyState { @@ -53,7 +53,7 @@ typedef enum NotifyState { NOTIFY_RELOADING, NOTIFY_STOPPING, _NOTIFY_STATE_MAX, - _NOTIFY_STATE_INVALID = -1 + _NOTIFY_STATE_INVALID = -EINVAL, } NotifyState; /* The values of this enum are referenced in man/systemd.exec.xml and src/shared/bus-unit-util.c. @@ -71,7 +71,7 @@ typedef enum ServiceResult { SERVICE_FAILURE_OOM_KILL, SERVICE_SKIP_CONDITION, _SERVICE_RESULT_MAX, - _SERVICE_RESULT_INVALID = -1 + _SERVICE_RESULT_INVALID = -EINVAL, } ServiceResult; typedef enum ServiceTimeoutFailureMode { @@ -79,7 +79,7 @@ typedef enum ServiceTimeoutFailureMode { SERVICE_TIMEOUT_ABORT, SERVICE_TIMEOUT_KILL, _SERVICE_TIMEOUT_FAILURE_MODE_MAX, - _SERVICE_TIMEOUT_FAILURE_MODE_INVALID = -1 + _SERVICE_TIMEOUT_FAILURE_MODE_INVALID = -EINVAL, } ServiceTimeoutFailureMode; struct ServiceFDStore { |