From 2d499ac86d177d5449b65df2887cbfbcfd4dcb52 Mon Sep 17 00:00:00 2001 From: anjiahao Date: Fri, 1 Apr 2022 15:48:15 +0800 Subject: [PATCH] lib_chdir:use change ret judgment method Signed-off-by: anjiahao --- libs/libc/unistd/lib_chdir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/libc/unistd/lib_chdir.c b/libs/libc/unistd/lib_chdir.c index 020027e8011..b4f6c1b244f 100644 --- a/libs/libc/unistd/lib_chdir.c +++ b/libs/libc/unistd/lib_chdir.c @@ -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;