Make unit_name_to_instance() return UnitNameFlags
The function returns non-negative UnitNameFlags on success, and negative errno on error. In the past we kept the return type as int because of those negative return values. But nowadays _UNIT_NAME_INVALID == -EINVAL. And if we tried to actually return something that doesn't fit in the return type, the compiler would throw an error. By changing to the "real" return type, we allow the debugger to use symbolic representation for the variables.
This commit is contained in:
@@ -22,8 +22,8 @@ bool unit_instance_is_valid(const char *i) _pure_;
|
||||
bool unit_suffix_is_valid(const char *s) _pure_;
|
||||
|
||||
int unit_name_to_prefix(const char *n, char **ret);
|
||||
int unit_name_to_instance(const char *n, char **ret);
|
||||
static inline int unit_name_classify(const char *n) {
|
||||
UnitNameFlags unit_name_to_instance(const char *n, char **ret);
|
||||
static inline UnitNameFlags unit_name_classify(const char *n) {
|
||||
return unit_name_to_instance(n, NULL);
|
||||
}
|
||||
int unit_name_to_prefix_and_instance(const char *n, char **ret);
|
||||
|
||||
Reference in New Issue
Block a user