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/08/31 16:22:10 UTC

[GitHub] [incubator-nuttx-apps] xiaoxiang781216 commented on a diff in pull request #1304: net/usrsock: fix usrsocktest test case break

xiaoxiang781216 commented on code in PR #1304:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1304#discussion_r959785460


##########
examples/usrsocktest/usrsocktest_daemon.c:
##########
@@ -1380,6 +1387,143 @@ static int getsockname_request(int fd, FAR struct daemon_priv_s *priv,
   return OK;
 }
 
+static int ioctl_request(int fd, FAR struct daemon_priv_s *priv,
+                         FAR void *hdrbuf)
+{
+  FAR struct usrsock_request_ioctl_s *req = hdrbuf;
+  struct usrsock_message_datareq_ack_s resp = {
+  };
+
+  FAR struct test_socket_s *tsock;
+  uint32_t value;
+  ssize_t wlen;
+  ssize_t rlen;
+  int ret;
+
+  /* Check if this socket exists. */
+
+  tsock = test_socket_get(priv, req->usockid);
+  if (!tsock)
+    {
+      ret = -EBADFD;
+      goto prepare;
+    }
+
+  if (req->arglen != sizeof(value))
+    {
+      ret = -EINVAL;
+      goto prepare;
+    }
+
+  if (req->cmd != FIONBIO)
+    {
+      ret = -EINVAL;

Review Comment:
   ENOTTY



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