mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-08-01 20:29:00 +00:00
nsh_ddcmd: print errno instead the return value when dd failed
Print the errno gives more information to debug the dd failed problem. Signed-off-by: Bowen Wang <wangbowen6@xiaomi.com>
This commit is contained in:
parent
51762a8958
commit
3d4442207d
1 changed files with 2 additions and 4 deletions
|
|
@ -105,8 +105,7 @@ static int dd_write(FAR struct dd_s *dd)
|
|||
if (nbytes < 0)
|
||||
{
|
||||
FAR struct nsh_vtbl_s *vtbl = dd->vtbl;
|
||||
nsh_error(vtbl, g_fmtcmdfailed, g_dd, "write",
|
||||
NSH_ERRNO_OF(-nbytes));
|
||||
nsh_error(vtbl, g_fmtcmdfailed, g_dd, "write", NSH_ERRNO);
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
|
|
@ -134,8 +133,7 @@ static int dd_read(FAR struct dd_s *dd)
|
|||
if (nbytes < 0)
|
||||
{
|
||||
FAR struct nsh_vtbl_s *vtbl = dd->vtbl;
|
||||
nsh_error(vtbl, g_fmtcmdfailed, g_dd, "read",
|
||||
NSH_ERRNO_OF(-nbytes));
|
||||
nsh_error(vtbl, g_fmtcmdfailed, g_dd, "read", NSH_ERRNO);
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue