JianyuWang0623 commented on code in PR #2737: URL: https://github.com/apache/nuttx-apps/pull/2737#discussion_r1803424091
########## nshlib/nsh_fileapps.c: ########## @@ -70,8 +70,7 @@ ****************************************************************************/ int nsh_fileapp(FAR struct nsh_vtbl_s *vtbl, FAR const char *cmd, - FAR char **argv, FAR const char *redirfile_in, - FAR const char *redirfile_out, int oflags) + FAR char **argv, FAR struct nsh_exec_param_s *exec) Review Comment: > add const for ALL pointer Done. ########## include/nshlib/nshlib.h: ########## @@ -65,6 +65,25 @@ # define SCHED_NSH SCHED_FIFO #endif +struct nsh_exec_param_s +{ + /* Redirect input/output through `fd` OR `path_name` + * + * Select one: + * 1. Using fd_in/fd_out as oldfd for dup2() if greater than -1. + * 2. Using file_in/file_out as full path to the file if it is + * not NULL, and oflags_in/oflags_out as flags for open(). + */ + + int fd_in; + int fd_out; + + int oflags_in; + int oflags_out; + FAR char *file_in; + FAR char *file_out; Review Comment: > add const to file_in/file_out Done. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org