diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2016-04-19 00:04:35 -0400 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2016-04-19 09:03:47 -0400 |
commit | 1fa0336081a671001a59ea56376132f3ef069a7b (patch) | |
tree | ec937d3dab1d66447205b879f4146e0620a2f14a /src | |
parent | af3d811352094f3f1304bdf8ba9cdd2b4b03b55c (diff) |
shared/install: change value of _UNIT_FILE_CHANGE_TYPE_INVALID
-1 could be confused with -EPERM. But we still need a negative enum
value to force gcc to use int for the enum type, even though it is
unused. Otherwise we get warnings.
Diffstat (limited to 'src')
-rw-r--r-- | src/shared/install.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/shared/install.h b/src/shared/install.h index 82c62095d5..4133faffa2 100644 --- a/src/shared/install.h +++ b/src/shared/install.h @@ -74,7 +74,7 @@ enum UnitFileChangeType { UNIT_FILE_UNLINK, UNIT_FILE_IS_MASKED, _UNIT_FILE_CHANGE_TYPE_MAX, - _UNIT_FILE_CHANGE_TYPE_INVALID = -1 + _UNIT_FILE_CHANGE_INVALID = INT_MIN }; /* type can either one of the UnitFileChangeTypes listed above, or a negative error. @@ -243,6 +243,7 @@ int unit_file_query_preset(UnitFileScope scope, const char *root_dir, const char const char *unit_file_state_to_string(UnitFileState s) _const_; UnitFileState unit_file_state_from_string(const char *s) _pure_; +/* from_string conversion is unreliable because of the overlap between -EPERM and -1 for error. */ const char *unit_file_change_type_to_string(UnitFileChangeType s) _const_; UnitFileChangeType unit_file_change_type_from_string(const char *s) _pure_; |