nshlib/nsh_console.c: Add fflush to nsh_consolewrite(). This resolves this problem:
> cat /dev/ttyCP & > echo ls >/dev/ttyCP Can't get the 'ls' result immediately, because 'cat' cmd uses nsh_consolewrite() and that uses fwrite with no fflush. We can get the 'ls' result after type '\n', because nsh will fflush output when get '\n'.
This commit is contained in:
parent
09691dd48f
commit
19dc7cd3b3
@ -186,6 +186,11 @@ static ssize_t nsh_consolewrite(FAR struct nsh_vtbl_s *vtbl,
|
||||
_err("ERROR: [%d] Failed to send buffer: %d\n",
|
||||
pstate->cn_outfd, errno);
|
||||
}
|
||||
|
||||
/* Flush the data to the output stream */
|
||||
|
||||
fflush(pstate->cn_outstream);
|
||||
|
||||
return ret;
|
||||
#else
|
||||
/* REVISIT: buffer may not be NUL-terminated */
|
||||
|
Loading…
x
Reference in New Issue
Block a user