summaryrefslogtreecommitdiff
path: root/src/udev/udev-rules.c
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/udev/udev-rules.c
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/udev/udev-rules.c')
-rw-r--r--src/udev/udev-rules.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/udev/udev-rules.c b/src/udev/udev-rules.c
index a87c5d119e..e12225ca39 100644
--- a/src/udev/udev-rules.c
+++ b/src/udev/udev-rules.c
@@ -41,7 +41,7 @@ typedef enum {
OP_ASSIGN, /* = */
OP_ASSIGN_FINAL, /* := */
_OP_TYPE_MAX,
- _OP_TYPE_INVALID = -1
+ _OP_TYPE_INVALID = -EINVAL,
} UdevRuleOperatorType;
typedef enum {
@@ -52,7 +52,7 @@ typedef enum {
MATCH_TYPE_GLOB_WITH_EMPTY, /* shell globs ?,*,[] with empty string, e.g., "|foo*" */
MATCH_TYPE_SUBSYSTEM, /* "subsystem", "bus", or "class" */
_MATCH_TYPE_MAX,
- _MATCH_TYPE_INVALID = -1
+ _MATCH_TYPE_INVALID = -EINVAL,
} UdevRuleMatchType;
typedef enum {
@@ -60,7 +60,7 @@ typedef enum {
SUBST_TYPE_FORMAT, /* % or $ */
SUBST_TYPE_SUBSYS, /* "[<SUBSYSTEM>/<KERNEL>]<attribute>" format */
_SUBST_TYPE_MAX,
- _SUBST_TYPE_INVALID = -1
+ _SUBST_TYPE_INVALID = -EINVAL,
} UdevRuleSubstituteType;
typedef enum {
@@ -123,7 +123,7 @@ typedef enum {
TK_A_RUN_PROGRAM, /* string */
_TK_TYPE_MAX,
- _TK_TYPE_INVALID = -1,
+ _TK_TYPE_INVALID = -EINVAL,
} UdevRuleTokenType;
typedef enum {