mirror of
https://github.com/apache/nuttx.git
synced 2026-05-24 07:46:16 +08:00
Squashed commit of the following:
psock_close() and net_close() are internal OS functions and should not set the errno variable.
psock_ioctl() and netdev_ioctl() are internal OS functions and should not set the errno variable.
net_dupsd() and net_dupsd2() are internal OS functions and should not set the errno variable.
net/ and fs/: net_vfcntl(), file_fcntl(), file_dup(), and file_dup2() are all internal OS interfaces and should not modify the errno value.
This commit is contained in:
@@ -1323,8 +1323,8 @@ static int netdev_rt_ioctl(FAR struct socket *psock, int cmd,
|
||||
* arg The argument of the ioctl cmd
|
||||
*
|
||||
* Return:
|
||||
* >=0 on success (positive non-zero values are cmd-specific)
|
||||
* On a failure, -1 is returned with errno set appropriately
|
||||
* A non-negative value is returned on success; a negated errno value is
|
||||
* returned on any failure to indicate the nature of the failure:
|
||||
*
|
||||
* EBADF
|
||||
* 'psock' is not a valid, connected socket structure.
|
||||
@@ -1350,8 +1350,7 @@ int psock_ioctl(FAR struct socket *psock, int cmd, unsigned long arg)
|
||||
|
||||
if (psock == NULL || psock->s_crefs <= 0)
|
||||
{
|
||||
ret = -EBADF;
|
||||
goto errout;
|
||||
return -EBADF;
|
||||
}
|
||||
|
||||
/* Execute the command. First check for a standard network IOCTL command. */
|
||||
@@ -1419,18 +1418,7 @@ int psock_ioctl(FAR struct socket *psock, int cmd, unsigned long arg)
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Check for success or failure */
|
||||
|
||||
if (ret >= 0)
|
||||
{
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* On failure, set the errno and return -1 */
|
||||
|
||||
errout:
|
||||
set_errno(-ret);
|
||||
return ERROR;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
@@ -1445,8 +1433,8 @@ errout:
|
||||
* arg The argument of the ioctl cmd
|
||||
*
|
||||
* Return:
|
||||
* >=0 on success (positive non-zero values are cmd-specific)
|
||||
* On a failure, -1 is returned with errno set appropriately
|
||||
* A non-negative value is returned on success; a negated errno value is
|
||||
* returned on any failure to indicate the nature of the failure:
|
||||
*
|
||||
* EBADF
|
||||
* 'sockfd' is not a valid socket descriptor.
|
||||
|
||||
Reference in New Issue
Block a user