system/nxinit: Let use a define to define the class max cmds

Avoid fixing the max 99 class cmds directly in the code.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
This commit is contained in:
Alan Carvalho de Assis 2026-05-27 09:32:32 -03:00 committed by Alan C. Assis
parent 7af8ed81fd
commit cdb89a54f6
2 changed files with 5 additions and 3 deletions

View file

@ -111,7 +111,7 @@ static int option_reboot_on_failure(FAR struct service_manager_s *sm,
static const struct cmd_map_s g_option[] =
{
{"class", 2, 99, option_class},
{"class", 2, NXINIT_ACTION_CMD_ARGS_MAX, option_class},
{"gentle_kill", 1, 1, option_gentle_kill},
{"restart_period", 2, 2, option_restart_period},
{"override", 1, 1, option_override},

View file

@ -66,7 +66,9 @@
#define SVC_REMOVE (1 << 31)
#define MAX_NXINIT_SERVICE_NAME 32
#define NXINIT_SERVICE_NAME_MAX 32
#define NXINIT_ACTION_CMD_ARGS_MAX 99
/****************************************************************************
* Public Types
@ -75,7 +77,7 @@
struct service_class_s
{
struct list_node node; /* Service class list node */
FAR char name[MAX_NXINIT_SERVICE_NAME];
FAR char name[NXINIT_SERVICE_NAME_MAX];
};
struct service_s