Commit Graph

5 Commits

Author SHA1 Message Date
Gregory Nutt
8cfa1dbd3b The previous commit was reverted. My concern was misplaced: There is a guard boolean to prevent running the init script more than once. This comment just restores some of the good cosmetic changes that were included in the reverted commit. 2016-08-25 14:28:25 -06:00
Gregory Nutt
4eda22b4db Revert "This commit adds nsh_consolechild(). I noticed that there are several examples that call nsh_consolemain.c to create to create a new NSH session. That will not always work because nsh_consolemain() performs the one-time initialization needed by the NSH library: Mounting, reading, and running the start-up script, configuring USB tracing. Some of those actions will cause failures if attempted twice."
This reverts commit 4d364d836a.
2016-08-25 14:19:36 -06:00
Gregory Nutt
4d364d836a This commit adds nsh_consolechild(). I noticed that there are several examples that call nsh_consolemain.c to create to create a new NSH session. That will not always work because nsh_consolemain() performs the one-time initialization needed by the NSH library: Mounting, reading, and running the start-up script, configuring USB tracing. Some of those actions will cause failures if attempted twice.
Here are some offenders: examples/cc3000/shell.c, examples/nsh/nsh_main.c, examples/nxterm/nxterm_main.c, and examples/pty_test/pty_test.c.  It is possible that for some of those, that represents the first call to nsh_consolemain().  But probably not.

To give other initialization options, I added nsh_consolechild() which is identical to nsh_consolemain() other than it omits all of the one-time initialization.  Of course, you would not get the result that you wanted if nsh_consolechild() were called without nsh_consolemain().
2016-08-25 14:14:23 -06:00
Gregory Nutt
e39cfc97c7 Add logic to support an NSH-specific system command 2016-08-25 11:34:36 -06:00
Gregory Nutt
0e76ca7474 Move apps/include/nsh.h to apps/include/nshlib/nshlib.h 2016-07-01 06:59:23 -06:00