Skip to content

Commit b7f2297

Browse files
committed
fix(nuttx): print error code when fl_exec_cmd fails
Show the fl_error_t value on both the startup command and interactive mode command failures. Signed-off-by: VIFEX <vifextech@foxmail.com>
1 parent 5b3628b commit b7f2297

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

App/func_loader/fl_port_nuttx.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,10 @@ static int interactive_mode(fl_context_t* ctx, int argc_first, char** argv_first
161161

162162
/* Execute first command if provided */
163163
if (argc_first > 1) {
164-
fl_exec_cmd(ctx, argc_first, (const char**)argv_first);
164+
const fl_error_t ret = fl_exec_cmd(ctx, argc_first, (const char**)argv_first);
165+
if (ret != FL_OK) {
166+
printf("Error: %d\n", ret);
167+
}
165168
}
166169

167170
while (1) {
@@ -190,7 +193,7 @@ static int interactive_mode(fl_context_t* ctx, int argc_first, char** argv_first
190193
if (argc > 0) {
191194
const fl_error_t ret = fl_exec_cmd(ctx, argc, argv);
192195
if (ret != FL_OK) {
193-
printf("Type 'q' to exit\n\n");
196+
printf("fl_error: %d. Type 'q' to exit\n\n", ret);
194197
}
195198
}
196199
}

0 commit comments

Comments
 (0)