nsh_dd: fix lseek return check.
- As was merged in commit 1852731df8
on
dd_main.c: lseek returns -1 on error.
Should be consistent in nsh_ddcmd.c and nsh_main.c.
This commit is contained in:
parent
3d8536f380
commit
a15403958d
@ -385,7 +385,7 @@ int cmd_dd(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv)
|
||||
if (dd.skip)
|
||||
{
|
||||
ret = lseek(dd.infd, dd.skip * dd.sectsize, SEEK_SET);
|
||||
if (ret < -1)
|
||||
if (ret < 0)
|
||||
{
|
||||
nsh_error(vtbl, g_fmtcmdfailed, g_dd, "skip lseek", NSH_ERRNO);
|
||||
ret = ERROR;
|
||||
@ -396,7 +396,7 @@ int cmd_dd(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv)
|
||||
if (dd.seek)
|
||||
{
|
||||
ret = lseek(dd.outfd, dd.seek * dd.sectsize, SEEK_SET);
|
||||
if (ret < -1)
|
||||
if (ret < 0)
|
||||
{
|
||||
nsh_error(vtbl, g_fmtcmdfailed, g_dd, "seek lseek", NSH_ERRNO);
|
||||
ret = ERROR;
|
||||
|
Loading…
Reference in New Issue
Block a user