nshlib: Fix nxstyle warning
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
parent
de8a56d149
commit
650b58d6b2
@ -47,8 +47,9 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
/* If a USB device is selected for the NSH console then we need to handle some
|
|
||||||
* special start-up conditions.
|
/* If a USB device is selected for the NSH console then we need to handle
|
||||||
|
* some special start-up conditions.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#undef HAVE_USB_CONSOLE
|
#undef HAVE_USB_CONSOLE
|
||||||
@ -138,7 +139,7 @@ void nsh_initialize(void);
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
int nsh_consolemain(int argc, char *argv[]);
|
int nsh_consolemain(int argc, FAR char *argv[]);
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: nsh_telnetstart
|
* Name: nsh_telnetstart
|
||||||
@ -226,7 +227,7 @@ int platform_user_verify(FAR const char *username, FAR const char *password);
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
int nsh_system(int argc, char *argv[]);
|
int nsh_system(int argc, FAR char *argv[]);
|
||||||
|
|
||||||
#undef EXTERN
|
#undef EXTERN
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
@ -78,7 +78,7 @@ static int nsh_clone_console(FAR struct console_stdio_s *pstate)
|
|||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Close stderr: note we only close stderr if we opened the alternative one */
|
/* Close stderr: we only close stderr if we opened the alternative one */
|
||||||
|
|
||||||
fclose(stderr);
|
fclose(stderr);
|
||||||
|
|
||||||
@ -101,7 +101,7 @@ static int nsh_clone_console(FAR struct console_stdio_s *pstate)
|
|||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Close stdout: note we only close stdout if we opened the alternative one */
|
/* Close stdout: we only close stdout if we opened the alternative one */
|
||||||
|
|
||||||
fclose(stdout);
|
fclose(stdout);
|
||||||
|
|
||||||
@ -202,7 +202,7 @@ static int nsh_wait_inputdev(FAR struct console_stdio_s *pstate,
|
|||||||
}
|
}
|
||||||
while (fd < 0);
|
while (fd < 0);
|
||||||
|
|
||||||
/* Close stdin: note we only closed stdin if we opened the alternative one */
|
/* Close stdin: we only closed stdin if we opened the alternative one */
|
||||||
|
|
||||||
fclose(stdin);
|
fclose(stdin);
|
||||||
|
|
||||||
@ -212,7 +212,7 @@ static int nsh_wait_inputdev(FAR struct console_stdio_s *pstate,
|
|||||||
|
|
||||||
if (fd != 0)
|
if (fd != 0)
|
||||||
{
|
{
|
||||||
/* No.. Dup the fd to create standard fd 0. stdin should not know. */
|
/* No.. Dup the fd to create standard fd 0. stdin should not know. */
|
||||||
|
|
||||||
dup2(fd, 0);
|
dup2(fd, 0);
|
||||||
|
|
||||||
@ -266,7 +266,7 @@ static int nsh_wait_inputdev(FAR struct console_stdio_s *pstate,
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
int nsh_consolemain(int argc, char *argv[])
|
int nsh_consolemain(int argc, FAR char *argv[])
|
||||||
{
|
{
|
||||||
FAR struct console_stdio_s *pstate = nsh_newconsole();
|
FAR struct console_stdio_s *pstate = nsh_newconsole();
|
||||||
FAR const char *msg;
|
FAR const char *msg;
|
||||||
@ -280,7 +280,9 @@ int nsh_consolemain(int argc, char *argv[])
|
|||||||
usbtrace_enable(TRACE_BITSET);
|
usbtrace_enable(TRACE_BITSET);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Execute the one-time start-up script. Any output will go to /dev/console. */
|
/* Execute the one-time start-up script.
|
||||||
|
* Any output will go to /dev/console.
|
||||||
|
*/
|
||||||
|
|
||||||
#ifdef CONFIG_NSH_ROMFSETC
|
#ifdef CONFIG_NSH_ROMFSETC
|
||||||
nsh_initscript(&pstate->cn_vtbl);
|
nsh_initscript(&pstate->cn_vtbl);
|
||||||
|
@ -79,7 +79,7 @@
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
int nsh_consolemain(int argc, char *argv[])
|
int nsh_consolemain(int argc, FAR char *argv[])
|
||||||
{
|
{
|
||||||
FAR struct console_stdio_s *pstate = nsh_newconsole();
|
FAR struct console_stdio_s *pstate = nsh_newconsole();
|
||||||
int ret;
|
int ret;
|
||||||
|
@ -149,7 +149,7 @@ static int ls_handler(FAR struct nsh_vtbl_s *vtbl, FAR const char *dirpath,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* A NULL entryp signifies that we are running ls on a single file */
|
/* NULL entry signifies that we are running ls on a single file */
|
||||||
|
|
||||||
ret = stat(dirpath, &buf);
|
ret = stat(dirpath, &buf);
|
||||||
}
|
}
|
||||||
@ -339,7 +339,7 @@ static int ls_recursive(FAR struct nsh_vtbl_s *vtbl, const char *dirpath,
|
|||||||
{
|
{
|
||||||
int ret = OK;
|
int ret = OK;
|
||||||
|
|
||||||
/* Is this entry a directory (and not one of the special directories, . and ..)? */
|
/* Is this entry a directory (not a special directories, e.g. . and ..)? */
|
||||||
|
|
||||||
if (DIRENT_ISDIRECTORY(entryp->d_type) && !ls_specialdir(entryp->d_name))
|
if (DIRENT_ISDIRECTORY(entryp->d_type) && !ls_specialdir(entryp->d_name))
|
||||||
{
|
{
|
||||||
@ -536,7 +536,9 @@ int cmd_cp(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
|
|||||||
|
|
||||||
if (S_ISDIR(buf.st_mode))
|
if (S_ISDIR(buf.st_mode))
|
||||||
{
|
{
|
||||||
/* Yes, it is a directory. Remove any trailing '/' characters from the path */
|
/* Yes, it is a directory.
|
||||||
|
* Remove any trailing '/' characters from the path
|
||||||
|
*/
|
||||||
|
|
||||||
nsh_trimdir(destpath);
|
nsh_trimdir(destpath);
|
||||||
|
|
||||||
@ -728,7 +730,9 @@ int cmd_losetup(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If a bad argument was encountered, then return without processing the command */
|
/* If a bad argument was encountered,
|
||||||
|
* then return without processing the command
|
||||||
|
*/
|
||||||
|
|
||||||
if (badarg)
|
if (badarg)
|
||||||
{
|
{
|
||||||
@ -898,7 +902,9 @@ int cmd_losmart(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If a bad argument was encountered, then return without processing the command */
|
/* If a bad argument was encountered,
|
||||||
|
* then return without processing the command
|
||||||
|
*/
|
||||||
|
|
||||||
if (badarg)
|
if (badarg)
|
||||||
{
|
{
|
||||||
@ -1105,7 +1111,9 @@ int cmd_ls(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If a bad argument was encountered, then return without processing the command */
|
/* If a bad argument was encountered,
|
||||||
|
* then return without processing the command
|
||||||
|
*/
|
||||||
|
|
||||||
if (badarg)
|
if (badarg)
|
||||||
{
|
{
|
||||||
@ -1269,7 +1277,9 @@ int cmd_mkfatfs(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If a bad argument was encountered, then return without processing the command */
|
/* If a bad argument was encountered,
|
||||||
|
* then return without processing the command
|
||||||
|
*/
|
||||||
|
|
||||||
if (badarg)
|
if (badarg)
|
||||||
{
|
{
|
||||||
@ -1392,7 +1402,9 @@ int cmd_mkrd(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If a bad argument was encountered, then return without processing the command */
|
/* If a bad argument was encountered,
|
||||||
|
* then return without processing the command
|
||||||
|
*/
|
||||||
|
|
||||||
if (badarg)
|
if (badarg)
|
||||||
{
|
{
|
||||||
|
@ -65,7 +65,7 @@ int nsh_script(FAR struct nsh_vtbl_s *vtbl, FAR const char *cmd,
|
|||||||
FAR char *pret;
|
FAR char *pret;
|
||||||
int ret = ERROR;
|
int ret = ERROR;
|
||||||
|
|
||||||
/* The path to the script may be relative to the current working directory */
|
/* The path to the script may relative to the current working directory */
|
||||||
|
|
||||||
fullpath = nsh_getfullpath(vtbl, path);
|
fullpath = nsh_getfullpath(vtbl, path);
|
||||||
if (!fullpath)
|
if (!fullpath)
|
||||||
@ -137,7 +137,7 @@ int nsh_script(FAR struct nsh_vtbl_s *vtbl, FAR const char *cmd,
|
|||||||
|
|
||||||
if ((vtbl->np.np_flags & NSH_PFLAG_SILENT) == 0)
|
if ((vtbl->np.np_flags & NSH_PFLAG_SILENT) == 0)
|
||||||
{
|
{
|
||||||
nsh_output(vtbl,"%s", buffer);
|
nsh_output(vtbl, "%s", buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = nsh_parse(vtbl, buffer);
|
ret = nsh_parse(vtbl, buffer);
|
||||||
|
@ -130,7 +130,9 @@ int nsh_session(FAR struct console_stdio_s *pstate, bool login)
|
|||||||
|
|
||||||
for (; ; )
|
for (; ; )
|
||||||
{
|
{
|
||||||
/* For the case of debugging the USB console... dump collected USB trace data */
|
/* For the case of debugging the USB console...
|
||||||
|
* dump collected USB trace data
|
||||||
|
*/
|
||||||
|
|
||||||
#ifdef CONFIG_NSH_USBDEV_TRACE
|
#ifdef CONFIG_NSH_USBDEV_TRACE
|
||||||
nsh_usbtrace();
|
nsh_usbtrace();
|
||||||
|
@ -120,7 +120,9 @@ int nsh_session(FAR struct console_stdio_s *pstate, bool login)
|
|||||||
|
|
||||||
for (; ; )
|
for (; ; )
|
||||||
{
|
{
|
||||||
/* For the case of debugging the USB console... dump collected USB trace data */
|
/* For the case of debugging the USB console...
|
||||||
|
* dump collected USB trace data
|
||||||
|
*/
|
||||||
|
|
||||||
#ifdef CONFIG_NSH_USBDEV_TRACE
|
#ifdef CONFIG_NSH_USBDEV_TRACE
|
||||||
nsh_usbtrace();
|
nsh_usbtrace();
|
||||||
|
@ -70,7 +70,7 @@
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
int nsh_system(int argc, char *argv[])
|
int nsh_system(int argc, FAR char *argv[])
|
||||||
{
|
{
|
||||||
FAR struct console_stdio_s *pstate = nsh_newconsole();
|
FAR struct console_stdio_s *pstate = nsh_newconsole();
|
||||||
FAR struct nsh_vtbl_s *vtbl;
|
FAR struct nsh_vtbl_s *vtbl;
|
||||||
|
@ -257,10 +257,10 @@ int nsh_telnetstart(sa_family_t family)
|
|||||||
usbtrace_enable(TRACE_BITSET);
|
usbtrace_enable(TRACE_BITSET);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Execute the startup script. If standard console is also defined, then
|
/* Execute the startup script. If standard console is also defined,
|
||||||
* we will not bother with the initscript here (although it is safe to
|
* then we will not bother with the initscript here (although it is
|
||||||
* call nshinitscript multiple times).
|
* safe to call nshinitscript multiple times).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if defined(CONFIG_NSH_ROMFSETC) && !defined(CONFIG_NSH_CONSOLE)
|
#if defined(CONFIG_NSH_ROMFSETC) && !defined(CONFIG_NSH_CONSOLE)
|
||||||
nsh_initscript(vtbl);
|
nsh_initscript(vtbl);
|
||||||
@ -286,7 +286,8 @@ int nsh_telnetstart(sa_family_t family)
|
|||||||
ret = telnetd_start(&config);
|
ret = telnetd_start(&config);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
_err("ERROR: Failed to start the Telnet IPv4 daemon: %d\n", ret);
|
_err("ERROR: Failed to start the Telnet IPv4 daemon: %d\n",
|
||||||
|
ret);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -302,7 +303,8 @@ int nsh_telnetstart(sa_family_t family)
|
|||||||
ret = telnetd_start(&config);
|
ret = telnetd_start(&config);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
_err("ERROR: Failed to start the Telnet IPv6 daemon: %d\n", ret);
|
_err("ERROR: Failed to start the Telnet IPv6 daemon: %d\n",
|
||||||
|
ret);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -328,11 +330,11 @@ int nsh_telnetstart(sa_family_t family)
|
|||||||
* nsh_telnetstart() or it may be started from the NSH command line using
|
* nsh_telnetstart() or it may be started from the NSH command line using
|
||||||
* this telnetd command.
|
* this telnetd command.
|
||||||
*
|
*
|
||||||
* Normally this command would be suppressed with CONFIG_NSH_DISABLE_TELNETD
|
* This command would be suppressed with CONFIG_NSH_DISABLE_TELNETD
|
||||||
* because the Telnet daemon is automatically started in nsh_main.c. The
|
* normally because the Telnet daemon is automatically started in
|
||||||
* exception is when CONFIG_NETINIT_NETLOCAL is selected. IN that case, the
|
* nsh_main.c. The exception is when CONFIG_NETINIT_NETLOCAL is selected.
|
||||||
* network is not enabled at initialization but rather must be enabled from
|
* IN that case, the network is not enabled at initialization but rather
|
||||||
* the NSH command line or via other applications.
|
* must be enabled from the NSH command line or via other applications.
|
||||||
*
|
*
|
||||||
* In that case, calling nsh_telnetstart() before the the network is
|
* In that case, calling nsh_telnetstart() before the the network is
|
||||||
* initialized will fail.
|
* initialized will fail.
|
||||||
|
@ -89,9 +89,10 @@ static void nsh_configstdio(int fd)
|
|||||||
dup2(fd, 1);
|
dup2(fd, 1);
|
||||||
dup2(fd, 2);
|
dup2(fd, 2);
|
||||||
|
|
||||||
/* fdopen to get the stdin, stdout and stderr streams. The following logic depends
|
/* fdopen to get the stdin, stdout and stderr streams. The following logic
|
||||||
* on the fact that the library layer will allocate FILEs in order. And since
|
* depends on the fact that the library layer will allocate FILEs in order.
|
||||||
* we closed stdin, stdout, and stderr above, that is what we should get.
|
* And since we closed stdin, stdout, and stderr above, that is what we
|
||||||
|
* should get.
|
||||||
*
|
*
|
||||||
* fd = 0 is stdin (read-only)
|
* fd = 0 is stdin (read-only)
|
||||||
* fd = 1 is stdout (write-only, append)
|
* fd = 1 is stdout (write-only, append)
|
||||||
@ -129,9 +130,9 @@ static int nsh_nullstdio(void)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
if (fd > 2)
|
if (fd > 2)
|
||||||
{
|
{
|
||||||
close(fd);
|
close(fd);
|
||||||
}
|
}
|
||||||
|
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
@ -171,8 +172,8 @@ restart:
|
|||||||
fd = open(CONFIG_NSH_USBCONDEV, O_RDWR);
|
fd = open(CONFIG_NSH_USBCONDEV, O_RDWR);
|
||||||
if (fd < 0)
|
if (fd < 0)
|
||||||
{
|
{
|
||||||
/* ENOTCONN means that the USB device is not yet connected. Anything
|
/* ENOTCONN means that the USB device is not yet connected.
|
||||||
* else is bad.
|
* Anything else is bad.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
DEBUGASSERT(errno == ENOTCONN);
|
DEBUGASSERT(errno == ENOTCONN);
|
||||||
@ -230,7 +231,7 @@ restart:
|
|||||||
|
|
||||||
nsh_configstdio(fd);
|
nsh_configstdio(fd);
|
||||||
|
|
||||||
/* We can close the original file descriptor now (unless it was one of 0-2) */
|
/* We can close the original file descriptor (unless it was one of 0-2) */
|
||||||
|
|
||||||
if (fd > 2)
|
if (fd > 2)
|
||||||
{
|
{
|
||||||
@ -257,7 +258,7 @@ restart:
|
|||||||
* operations to handle the cases where the session is lost when the
|
* operations to handle the cases where the session is lost when the
|
||||||
* USB device is unplugged and restarted when the USB device is plugged
|
* USB device is unplugged and restarted when the USB device is plugged
|
||||||
* in again.
|
* in again.
|
||||||
*
|
*
|
||||||
* Input Parameters:
|
* Input Parameters:
|
||||||
* Standard task start-up arguments. These are not used. argc may be
|
* Standard task start-up arguments. These are not used. argc may be
|
||||||
* zero and argv may be NULL.
|
* zero and argv may be NULL.
|
||||||
@ -268,7 +269,7 @@ restart:
|
|||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
int nsh_consolemain(int argc, char *argv[])
|
int nsh_consolemain(int argc, FAR char *argv[])
|
||||||
{
|
{
|
||||||
FAR struct console_stdio_s *pstate = nsh_newconsole();
|
FAR struct console_stdio_s *pstate = nsh_newconsole();
|
||||||
struct boardioc_usbdev_ctrl_s ctrl;
|
struct boardioc_usbdev_ctrl_s ctrl;
|
||||||
@ -327,7 +328,7 @@ int nsh_consolemain(int argc, char *argv[])
|
|||||||
|
|
||||||
/* Now loop, executing creating a session for each USB connection */
|
/* Now loop, executing creating a session for each USB connection */
|
||||||
|
|
||||||
for (;;)
|
for (; ; )
|
||||||
{
|
{
|
||||||
/* Wait for the USB to be connected to the host and switch
|
/* Wait for the USB to be connected to the host and switch
|
||||||
* standard I/O to the USB serial device.
|
* standard I/O to the USB serial device.
|
||||||
|
@ -177,7 +177,7 @@ int main(int argc, FAR char *argv[])
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_NSH_CONSOLE
|
#ifdef CONFIG_NSH_CONSOLE
|
||||||
/* If the serial console front end is selected, then run it on this thread */
|
/* If the serial console front end is selected, run it on this thread */
|
||||||
|
|
||||||
ret = nsh_consolemain(0, NULL);
|
ret = nsh_consolemain(0, NULL);
|
||||||
|
|
||||||
|
@ -212,15 +212,16 @@ FILE *popen(FAR const char *command, FAR const char *mode)
|
|||||||
goto errout_with_actions;
|
goto errout_with_actions;
|
||||||
}
|
}
|
||||||
|
|
||||||
errcode = task_spawnattr_setstacksize(&attr, CONFIG_SYSTEM_POPEN_STACKSIZE);
|
errcode = task_spawnattr_setstacksize(&attr,
|
||||||
|
CONFIG_SYSTEM_POPEN_STACKSIZE);
|
||||||
if (errcode != 0)
|
if (errcode != 0)
|
||||||
{
|
{
|
||||||
goto errout_with_actions;
|
goto errout_with_actions;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If robin robin scheduling is enabled, then set the scheduling policy
|
/* If robin robin scheduling is enabled, then set the scheduling policy
|
||||||
* of the new task to SCHED_RR before it has a chance to run.
|
* of the new task to SCHED_RR before it has a chance to run.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if CONFIG_RR_INTERVAL > 0
|
#if CONFIG_RR_INTERVAL > 0
|
||||||
errcode = posix_spawnattr_setschedpolicy(&attr, SCHED_RR);
|
errcode = posix_spawnattr_setschedpolicy(&attr, SCHED_RR);
|
||||||
@ -332,22 +333,22 @@ errout:
|
|||||||
* waitpid() with a pid argument less than or equal to 0 or equal to the
|
* waitpid() with a pid argument less than or equal to 0 or equal to the
|
||||||
* process ID of the command line interpreter
|
* process ID of the command line interpreter
|
||||||
*
|
*
|
||||||
* Any other function not defined in this volume of IEEE Std 1003.1-2001 that
|
* Any other function not defined in this volume of IEEE Std 1003.1-2001
|
||||||
* could do one of the above
|
* that could do one of the above
|
||||||
*
|
*
|
||||||
* In any case, pclose() will not return before the child process created by
|
* In any case, pclose() will not return before the child process created
|
||||||
* popen() has terminated.
|
* by popen() has terminated.
|
||||||
*
|
*
|
||||||
* If the command language interpreter cannot be executed, the child termination
|
* If the command language interpreter cannot be executed, the child
|
||||||
* status returned by pclose() will be as if the command language interpreter
|
* termination status returned by pclose() will be as if the command
|
||||||
* terminated using exit(127) or _exit(127).
|
* language interpreter terminated using exit(127) or _exit(127).
|
||||||
*
|
*
|
||||||
* The pclose() function will not affect the termination status of any child of
|
* The pclose() function will not affect the termination status of any
|
||||||
* the calling process other than the one created by popen() for the associated
|
* child of the calling process other than the one created by popen() for
|
||||||
* stream.
|
* the associated stream.
|
||||||
*
|
*
|
||||||
* If the argument stream to pclose() is not a pointer to a stream created by
|
* If the argument stream to pclose() is not a pointer to a stream created
|
||||||
* popen(), the result of pclose() is undefined.
|
* by popen(), the result of pclose() is undefined.
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* stream - The stream reference returned by a previous call to popen()
|
* stream - The stream reference returned by a previous call to popen()
|
||||||
@ -377,8 +378,8 @@ int pclose(FILE *stream)
|
|||||||
|
|
||||||
memcpy(original, &container->copy, sizeof(FILE));
|
memcpy(original, &container->copy, sizeof(FILE));
|
||||||
|
|
||||||
/* Then close the original and free the container (saving the PID of the shell
|
/* Then close the original and free the container (saving the PID of the
|
||||||
* process)
|
* shell process)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
fclose(original);
|
fclose(original);
|
||||||
@ -389,13 +390,13 @@ int pclose(FILE *stream)
|
|||||||
#ifdef CONFIG_SCHED_WAITPID
|
#ifdef CONFIG_SCHED_WAITPID
|
||||||
/* Wait for the shell to exit, retrieving the return value if available. */
|
/* Wait for the shell to exit, retrieving the return value if available. */
|
||||||
|
|
||||||
result = waitpid(shell, &status, 0);
|
result = waitpid(shell, &status, 0);
|
||||||
if (result < 0)
|
if (result < 0)
|
||||||
{
|
{
|
||||||
/* The errno has already been set */
|
/* The errno has already been set */
|
||||||
|
|
||||||
return ERROR;
|
return ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
#else
|
#else
|
||||||
|
@ -105,15 +105,16 @@ int system(FAR const char *cmd)
|
|||||||
goto errout_with_attrs;
|
goto errout_with_attrs;
|
||||||
}
|
}
|
||||||
|
|
||||||
errcode = task_spawnattr_setstacksize(&attr, CONFIG_SYSTEM_SYSTEM_STACKSIZE);
|
errcode = task_spawnattr_setstacksize(&attr,
|
||||||
|
CONFIG_SYSTEM_SYSTEM_STACKSIZE);
|
||||||
if (errcode != 0)
|
if (errcode != 0)
|
||||||
{
|
{
|
||||||
goto errout_with_attrs;
|
goto errout_with_attrs;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If robin robin scheduling is enabled, then set the scheduling policy
|
/* If robin robin scheduling is enabled, then set the scheduling policy
|
||||||
* of the new task to SCHED_RR before it has a chance to run.
|
* of the new task to SCHED_RR before it has a chance to run.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if CONFIG_RR_INTERVAL > 0
|
#if CONFIG_RR_INTERVAL > 0
|
||||||
errcode = posix_spawnattr_setschedpolicy(&attr, SCHED_RR);
|
errcode = posix_spawnattr_setschedpolicy(&attr, SCHED_RR);
|
||||||
|
Loading…
Reference in New Issue
Block a user