basic/unit-name: make sure UnitNameFlags is signed

Without that, a check like unit_name_to_instance(...) < 0 would not
have the expected effect.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2019-12-19 20:57:27 +01:00
parent aa0f357fd8
commit f9ef25a483
2 changed files with 5 additions and 0 deletions
+1
View File
@@ -13,6 +13,7 @@ typedef enum UnitNameFlags {
UNIT_NAME_TEMPLATE = 1 << 1, /* Allow foo@.service */
UNIT_NAME_INSTANCE = 1 << 2, /* Allow foo@bar.service */
UNIT_NAME_ANY = UNIT_NAME_PLAIN|UNIT_NAME_TEMPLATE|UNIT_NAME_INSTANCE,
_UNIT_NAME_INVALID = -1,
} UnitNameFlags;
bool unit_name_is_valid(const char *n, UnitNameFlags flags) _pure_;