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/10/21 03:50:09 UTC

[GitHub] [incubator-nuttx] zhhyu7 opened a new pull request, #7378: Some relatively reasonable error code modifications

zhhyu7 opened a new pull request, #7378:
URL: https://github.com/apache/incubator-nuttx/pull/7378

   ## Summary
   
   ## Impact
   
   ## Testing
   usrsocktest OK.
   
   


-- 
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] zhhyu7 commented on a diff in pull request #7378: Some relatively reasonable error code modifications

Posted by GitBox <gi...@apache.org>.
zhhyu7 commented on code in PR #7378:
URL: https://github.com/apache/incubator-nuttx/pull/7378#discussion_r1001342005


##########
net/socket/setsockopt.c:
##########
@@ -82,7 +82,7 @@ static int psock_socketlevel_option(FAR struct socket *psock, int option,
 
   if (!value)
     {
-      return -EINVAL;
+      return -EFAULT;

Review Comment:
   https://github.com/linux-test-project/ltp/blob/3e0e60074495e1c350b634848e5dd1f7993ec2ef/testcases/kernel/syscalls/setsockopt/setsockopt01.c#L39-L40



-- 
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] zhhyu7 commented on a diff in pull request #7378: Some relatively reasonable error code modifications

Posted by GitBox <gi...@apache.org>.
zhhyu7 commented on code in PR #7378:
URL: https://github.com/apache/incubator-nuttx/pull/7378#discussion_r1001339983


##########
net/inet/inet_sockif.c:
##########
@@ -407,7 +407,7 @@ static int inet_bind(FAR struct socket *psock,
   if (addrlen < minlen)
     {
       nerr("ERROR: Invalid address length: %d < %d\n", addrlen, minlen);
-      return -EBADF;

Review Comment:
   https://github.com/linux-test-project/ltp/blob/3e0e60074495e1c350b634848e5dd1f7993ec2ef/testcases/kernel/syscalls/bind/bind01.c#L34-L35



-- 
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] zhhyu7 commented on a diff in pull request #7378: Some relatively reasonable error code modifications

Posted by GitBox <gi...@apache.org>.
zhhyu7 commented on code in PR #7378:
URL: https://github.com/apache/incubator-nuttx/pull/7378#discussion_r1001340690


##########
net/socket/socketpair.c:
##########
@@ -150,6 +150,11 @@ int socketpair(int domain, int type, int protocol, int sv[2])
       oflags |= O_CLOEXEC;
     }
 
+  if (type & SOCK_NONBLOCK)

Review Comment:
   https://github.com/linux-test-project/ltp/blob/3e0e60074495e1c350b634848e5dd1f7993ec2ef/testcases/kernel/syscalls/socketpair/socketpair02.c#L37



-- 
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] zhhyu7 commented on a diff in pull request #7378: Some relatively reasonable error code modifications

Posted by GitBox <gi...@apache.org>.
zhhyu7 commented on code in PR #7378:
URL: https://github.com/apache/incubator-nuttx/pull/7378#discussion_r1001341465


##########
net/inet/inet_sockif.c:
##########
@@ -1809,23 +1809,15 @@ FAR const struct sock_intf_s *
     }
   else
 #endif
-#ifdef NET_UDP_HAVE_STACK
-  if (type == SOCK_DGRAM && (protocol == 0 || protocol == IPPROTO_UDP))
-    {
-      return &g_inet_sockif;
-    }
-  else
-#endif
-#ifdef NET_TCP_HAVE_STACK
-  if (type == SOCK_STREAM && (protocol == 0 || protocol == IPPROTO_TCP))
+#if defined(NET_UDP_HAVE_STACK) || defined(NET_TCP_HAVE_STACK)

Review Comment:
   https://github.com/linux-test-project/ltp/blob/3e0e60074495e1c350b634848e5dd1f7993ec2ef/testcases/kernel/syscalls/socket/socket01.c#L34-L39



-- 
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] zhhyu7 commented on a diff in pull request #7378: Some relatively reasonable error code modifications

Posted by GitBox <gi...@apache.org>.
zhhyu7 commented on code in PR #7378:
URL: https://github.com/apache/incubator-nuttx/pull/7378#discussion_r1001341612


##########
net/socket/socket.c:
##########
@@ -82,6 +82,11 @@ int psock_socket(int domain, int type, int protocol,
   FAR const struct sock_intf_s *sockif = NULL;
   int ret;
 
+  if (type & ~(SOCK_CLOEXEC | SOCK_NONBLOCK | SOCK_TYPE_MASK))

Review Comment:
   https://github.com/linux-test-project/ltp/blob/3e0e60074495e1c350b634848e5dd1f7993ec2ef/testcases/kernel/syscalls/socket/socket01.c#L32



-- 
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] xiaoxiang781216 merged pull request #7378: Some relatively reasonable error code modifications

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 merged PR #7378:
URL: https://github.com/apache/incubator-nuttx/pull/7378


-- 
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