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:
Zbigniew Jędrzejewski-Szmek
2021-05-05 15:08:48 +02:00
parent 73e799387f
commit 73ce91a05a
5 changed files with 12 additions and 12 deletions
+1 -1
View File
@@ -471,8 +471,8 @@ static void test_build_parent_slice(void) {
}
static void test_unit_name_to_instance(void) {
UnitNameFlags r;
char *instance;
int r;
log_info("/* %s */", __func__);