This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git

commit cdb89a54f63344401f1a2d306b06806f3d153e22
Author: Alan Carvalho de Assis <[email protected]>
AuthorDate: Wed May 27 09:32:32 2026 -0300

    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 <[email protected]>
---
 system/nxinit/service.c | 2 +-
 system/nxinit/service.h | 6 ++++--
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/system/nxinit/service.c b/system/nxinit/service.c
index 3f7578fea..847b1a31d 100644
--- a/system/nxinit/service.c
+++ b/system/nxinit/service.c
@@ -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},
diff --git a/system/nxinit/service.h b/system/nxinit/service.h
index babf6edd2..645200648 100644
--- a/system/nxinit/service.h
+++ b/system/nxinit/service.h
@@ -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

Reply via email to