You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ag...@apache.org on 2020/02/06 22:43:49 UTC
[incubator-nuttx-apps] 01/02: Change unimplemented requests
behaviour in gs2200m
This is an automated email from the ASF dual-hosted git repository.
aguettouche pushed a commit to branch pr55
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git
commit a5dff52a719fee9e4cadcad240dce826f4fa9c54
Author: Miguel Herranz <mi...@midokura.com>
AuthorDate: Thu Feb 6 19:54:41 2020 +0100
Change unimplemented requests behaviour in gs2200m
The ASSERT is too strong, as it cannot be disabled, so changing to
DEBUGASSERT, as calling these functions should not be a problem as
long as the application logic handle the error correctly.
The error code is changed to ENOSYS, as it seems to better reflect
the fact that the call itself would be valid, but the functionality
is not implemented (see [1] or `man errno`).
[1] https://www.gnu.org/software/libc/manual/html_node/Error-Codes.html
---
wireless/gs2200m/gs2200m_main.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/wireless/gs2200m/gs2200m_main.c b/wireless/gs2200m/gs2200m_main.c
index 604c89f..3f87a0b 100644
--- a/wireless/gs2200m/gs2200m_main.c
+++ b/wireless/gs2200m/gs2200m_main.c
@@ -1221,8 +1221,8 @@ err_out:
static int setsockopt_request(int fd, FAR struct gs2200m_s *priv,
FAR void *hdrbuf)
{
- ASSERT(false);
- return -EINVAL;
+ DEBUGASSERT(false);
+ return -ENOSYS;
}
/****************************************************************************
@@ -1232,8 +1232,8 @@ static int setsockopt_request(int fd, FAR struct gs2200m_s *priv,
static int getsockopt_request(int fd, FAR struct gs2200m_s *priv,
FAR void *hdrbuf)
{
- ASSERT(false);
- return -EINVAL;
+ DEBUGASSERT(false);
+ return -ENOSYS;
}
/****************************************************************************
@@ -1243,8 +1243,8 @@ static int getsockopt_request(int fd, FAR struct gs2200m_s *priv,
static int getsockname_request(int fd, FAR struct gs2200m_s *priv,
FAR void *hdrbuf)
{
- ASSERT(false);
- return -EINVAL;
+ DEBUGASSERT(false);
+ return -ENOSYS;
}
/****************************************************************************
@@ -1254,8 +1254,8 @@ static int getsockname_request(int fd, FAR struct gs2200m_s *priv,
static int getpeername_request(int fd, FAR struct gs2200m_s *priv,
FAR void *hdrbuf)
{
- ASSERT(false);
- return -EINVAL;
+ DEBUGASSERT(false);
+ return -ENOSYS;
}
/****************************************************************************