Make unit_name_to_instance() return UnitNameFlags
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 4 May 2021 16:40:02 +0000 (18:40 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 5 May 2021 13:08:48 +0000 (15:08 +0200)
commit73ce91a05a63f44367b48a7ef3ca1ce4e85205b3
tree0a15417b3a1d5dde5ac03644c2ca8a77c380f144
parent73e799387f26aacef544d97137826c4760982e12
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.
src/basic/unit-file.c
src/basic/unit-name.c
src/basic/unit-name.h
src/shared/install.c
src/test/test-unit-name.c