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
This commit is contained in:
parent
2f4b309b1b
commit
a5dff52a71
@ -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;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
Loading…
Reference in New Issue
Block a user