int sw_shutdown(int __fd, int __how)
{
struct sock_list *list;
+ int rc;
/* Find socket in management structure. */
list = list_elem_from_socket(__fd);
/* Remove socket from socket management structure. */
if (list->rw_state == STATE_SHUT_RDWR) {
- list = list_unlink_socket(__fd);
- if (list == NULL) {
+ rc = list_remove_socket(__fd);
+ if (rc < 0) {
errno = EBADF;
goto list_unlink_err;
}
*/
int sw_close(int __fd)
{
- struct sock_list *list;
+ int rc;
/* Remove socket from socket management structure. */
- list = list_unlink_socket(__fd);
- if (list == NULL) {
+ rc = list_remove_socket(__fd);
+ if (rc < 0) {
errno = EBADF;
goto list_unlink_err;
}