You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/04/01 12:15:44 UTC

[GitHub] [incubator-nuttx] anjiahao1 opened a new pull request #5949: lib_chdir:change ret judgment method

anjiahao1 opened a new pull request #5949:
URL: https://github.com/apache/incubator-nuttx/pull/5949


   don't use ret!=0,just use ret
   Signed-off-by: anjiahao <an...@xiaomi.com>
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] pkarashchenko commented on a change in pull request #5949: lib_chdir:change ret judgment method

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on a change in pull request #5949:
URL: https://github.com/apache/incubator-nuttx/pull/5949#discussion_r840530634



##########
File path: 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)

Review comment:
       could you please explain why `!= 0` is wrong?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] pkarashchenko merged pull request #5949: lib_chdir:change ret judgment method

Posted by GitBox <gi...@apache.org>.
pkarashchenko merged pull request #5949:
URL: https://github.com/apache/incubator-nuttx/pull/5949


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] anjiahao1 commented on a change in pull request #5949: lib_chdir:change ret judgment method

Posted by GitBox <gi...@apache.org>.
anjiahao1 commented on a change in pull request #5949:
URL: https://github.com/apache/incubator-nuttx/pull/5949#discussion_r840536497



##########
File path: 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)

Review comment:
       ok,i use coverity scan it.coveriy suggest use ret. it does not mean `!=` is wrong 🐰 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] pkarashchenko commented on a change in pull request #5949: lib_chdir:change ret judgment method

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on a change in pull request #5949:
URL: https://github.com/apache/incubator-nuttx/pull/5949#discussion_r840537966



##########
File path: 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)

Review comment:
       maybe `ret < 0` then?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org