1
0
mirror of https://github.com/systemd/systemd.git synced 2025-03-28 02:50:16 +03:00

unit-def: ensure UnitType enum fits any errno value

This is a follow-up for #19514 which changed unit_name_to_instance() to
return ENOMEM as a UnitType enum, even though the enum didn't
necessarily have range for that.

Let's extend the range explicitly, so that we can cover the full errno
range in it.
This commit is contained in:
Lennart Poettering 2021-05-10 18:43:07 +02:00 committed by Yu Watanabe
parent 7eea910d24
commit c37f7963b1

View File

@ -3,6 +3,7 @@
#include <stdbool.h>
#include "errno-list.h"
#include "locale-util.h"
#include "macro.h"
@ -23,6 +24,7 @@ typedef enum UnitType {
UNIT_SCOPE,
_UNIT_TYPE_MAX,
_UNIT_TYPE_INVALID = -EINVAL,
_UNIT_TYPE_ERRNO_MAX = -ERRNO_MAX, /* Ensure the whole errno range fits into this enum */
} UnitType;
typedef enum UnitLoadState {