lib_chdir:use change ret judgment method

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
This commit is contained in:
anjiahao 2022-04-01 15:48:15 +08:00 committed by Petro Karashchenko
parent 79bcc662d9
commit 2d499ac86d

View File

@ -115,7 +115,7 @@ int chdir(FAR const char *path)
/* Verify that 'path' refers to a directory */
ret = stat(path, &buf);
if (ret != 0)
if (ret < 0)
{
errcode = ENOENT;
goto errout;