summaryrefslogtreecommitdiff
path: root/components/net/sal_socket/socket
diff options
context:
space:
mode:
authoryangjie11 <[email protected]>2018-11-28 19:02:11 +0800
committerGitHub <[email protected]>2018-11-28 19:02:11 +0800
commit1a7f95f92b84b0a3acd6243cb2a658b4f9b6f1ac (patch)
tree3b90c3e4b7ced83ce239ae8df020926eaf74d7de /components/net/sal_socket/socket
parent4a43d3cdae1b731dcf51d3531048c51fd4142516 (diff)
parentd4469fe7d83d08913d096dc6d75a750dd854c0cc (diff)
Merge pull request #1 from RT-Thread/master
test
Diffstat (limited to 'components/net/sal_socket/socket')
-rw-r--r--components/net/sal_socket/socket/net_netdb.c19
-rw-r--r--components/net/sal_socket/socket/net_sockets.c23
2 files changed, 8 insertions, 34 deletions
diff --git a/components/net/sal_socket/socket/net_netdb.c b/components/net/sal_socket/socket/net_netdb.c
index 5acab36403..bc76a48965 100644
--- a/components/net/sal_socket/socket/net_netdb.c
+++ b/components/net/sal_socket/socket/net_netdb.c
@@ -1,21 +1,7 @@
/*
- * File : net_netdb.c
- * This file is part of RT-Thread RTOS
- * COPYRIGHT (C) 2015, RT-Thread Development Team
+ * Copyright (c) 2006-2018, RT-Thread Development Team
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
@@ -38,6 +24,7 @@ int gethostbyname_r(const char *name, struct hostent *ret, char *buf,
{
return sal_gethostbyname_r(name, ret, buf, buflen, result, h_errnop);
}
+RTM_EXPORT(gethostbyname_r);
void freeaddrinfo(struct addrinfo *ai)
{
diff --git a/components/net/sal_socket/socket/net_sockets.c b/components/net/sal_socket/socket/net_sockets.c
index f181ee14d5..232b87ba1e 100644
--- a/components/net/sal_socket/socket/net_sockets.c
+++ b/components/net/sal_socket/socket/net_sockets.c
@@ -1,21 +1,7 @@
/*
- * File : net_sockets.c
- * This file is part of RT-Thread RTOS
- * COPYRIGHT (C) 2015, RT-Thread Development Team
+ * Copyright (c) 2006-2018, RT-Thread Development Team
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
@@ -47,8 +33,7 @@ int accept(int s, struct sockaddr *addr, socklen_t *addrlen)
if (fd < 0)
{
rt_set_errno(-ENOMEM);
- sal_closesocket(socket);
-
+ sal_closesocket(new_socket);
return -1;
}
@@ -74,6 +59,8 @@ int accept(int s, struct sockaddr *addr, socklen_t *addrlen)
return fd;
}
+ rt_set_errno(-ENOMEM);
+ sal_closesocket(new_socket);
return -1;
}