mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-08-18 20:18:21 +00:00
system/nxinit: Fix action event parsing loss
init.rc
on boot && property:sys.boot.reason!=bootloader
echo "On boot, the reason is not BL."
Before fixing
init_main: action 0x40436120
init_main: sys.boot.reason!=bootloader
init_main: argv[0] 'echo'
init_main: argv[1] 'On boot, the reason is not BL.'
After fixing
init_main: action 0x40436120
init_main: sys.boot.reason!=bootloader
+ init_main: default==boot
init_main: argv[0] 'echo'
init_main: argv[1] 'On boot, the reason is not BL.'
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
This commit is contained in:
parent
99dd131a72
commit
1290acf35c
1 changed files with 8 additions and 8 deletions
|
|
@ -397,15 +397,16 @@ int init_action_parse(FAR const struct parser_s *parser,
|
|||
|
||||
while (--ret > 0)
|
||||
{
|
||||
int n;
|
||||
|
||||
if (!strncmp(argv[ret], ACTION_SECTION_PROP_PREFIX,
|
||||
strlen(ACTION_SECTION_PROP_PREFIX)))
|
||||
{
|
||||
ret = parse_event(argv[ret], a->events,
|
||||
nitems(a->events));
|
||||
if (ret < 0)
|
||||
n = parse_event(argv[ret], a->events, nitems(a->events));
|
||||
if (n < 0)
|
||||
{
|
||||
free(a);
|
||||
return ret;
|
||||
return n;
|
||||
}
|
||||
}
|
||||
else if (strncmp(argv[ret], ACTION_SECTION_AND_PREFIX,
|
||||
|
|
@ -414,12 +415,11 @@ int init_action_parse(FAR const struct parser_s *parser,
|
|||
char tmp[CONFIG_SYSTEM_NXINIT_RC_LINE_MAX];
|
||||
|
||||
sprintf(tmp, ":%s=%s", ACTION_PROP_KEY_DEFAULT, argv[ret]);
|
||||
ret = parse_event(tmp, a->events,
|
||||
nitems(a->events));
|
||||
if (ret < 0)
|
||||
n = parse_event(tmp, a->events, nitems(a->events));
|
||||
if (n < 0)
|
||||
{
|
||||
free(a);
|
||||
return ret;
|
||||
return n;
|
||||
}
|
||||
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue