Fix an error in last commit; eliminate a warning
This commit is contained in:
parent
186a101d2c
commit
50f44f23f2
@ -76,7 +76,7 @@ static void nsh_consolerelease(FAR struct nsh_vtbl_s *vtbl);
|
||||
static ssize_t nsh_consolewrite(FAR struct nsh_vtbl_s *vtbl,
|
||||
FAR const void *buffer, size_t nbytes);
|
||||
static int nsh_consoleoutput(FAR struct nsh_vtbl_s *vtbl,
|
||||
FAR const char *fmt, ...);
|
||||
FAR const IPTR char *fmt, ...);
|
||||
static FAR char *nsh_consolelinebuffer(FAR struct nsh_vtbl_s *vtbl);
|
||||
|
||||
#if CONFIG_NFILE_DESCRIPTORS > 0
|
||||
|
@ -116,7 +116,7 @@ struct nsh_vtbl_s
|
||||
#endif
|
||||
ssize_t (*write)(FAR struct nsh_vtbl_s *vtbl, FAR const void *buffer,
|
||||
size_t nbytes);
|
||||
int (*output)(FAR struct nsh_vtbl_s *vtbl, FAR const IOBJ char *fmt, ...);
|
||||
int (*output)(FAR struct nsh_vtbl_s *vtbl, FAR const IPTR char *fmt, ...);
|
||||
FAR char *(*linebuffer)(FAR struct nsh_vtbl_s *vtbl);
|
||||
#if CONFIG_NFILE_DESCRIPTORS > 0
|
||||
void (*redirect)(FAR struct nsh_vtbl_s *vtbl, int fd, FAR uint8_t *save);
|
||||
|
@ -136,19 +136,20 @@ int nsh_catfile(FAR struct nsh_vtbl_s *vtbl, FAR const char *cmd,
|
||||
ssize_t n = nsh_write(vtbl, buffer, nbytesread);
|
||||
if (n < 0)
|
||||
{
|
||||
int errval = errno;
|
||||
int errcode = errno;
|
||||
|
||||
/* EINTR is not an error (but will stop stop the cat) */
|
||||
|
||||
#ifndef CONFIG_DISABLE_SIGNALS
|
||||
if (errval == EINTR)
|
||||
if (errcode == EINTR)
|
||||
{
|
||||
nsh_output(vtbl, g_fmtsignalrecvd, cmd);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
nsh_output(vtbl, g_fmtcmdfailed, cmd, "write", NSH_ERRNO);
|
||||
nsh_output(vtbl, g_fmtcmdfailed, cmd, "write",
|
||||
NSH_ERRNO_OF(errcode));
|
||||
}
|
||||
|
||||
ret = ERROR;
|
||||
|
Loading…
x
Reference in New Issue
Block a user