mirror of
https://github.com/apache/nuttx-apps.git
synced 2025-10-20 21:41:18 +08: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:
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user