mirror of
https://github.com/apache/nuttx-apps.git
synced 2025-10-18 17:32:09 +08:00
Replace self defined macros with NET_SOCK_[FAMILY|TYPE|PROTOCOL]
NET_SOCK_* is defined by nuttx/net/netconfig.h and then can be shared Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:

committed by
Gustavo Henrique Nihei

parent
fcd69d1cdf
commit
66dbaa4539
@@ -202,16 +202,6 @@
|
||||
# undef CONFIG_NETINIT_MONITOR
|
||||
#endif
|
||||
|
||||
/* We need a valid IP domain (any domain) to create a socket that we can use
|
||||
* to communicate with the network device.
|
||||
*/
|
||||
|
||||
#if defined(CONFIG_NET_IPv4)
|
||||
# define AF_INETX AF_INET
|
||||
#elif defined(CONFIG_NET_IPv6)
|
||||
# define AF_INETX AF_INET6
|
||||
#endif
|
||||
|
||||
/* While the network is up, the network monitor really does nothing. It
|
||||
* will wait for a very long time while waiting, it can be awakened by a
|
||||
* signal indicating a change in network status.
|
||||
@@ -763,7 +753,7 @@ static int netinit_monitor(void)
|
||||
* interface driver.
|
||||
*/
|
||||
|
||||
sd = socket(AF_INETX, SOCK_DGRAM, 0);
|
||||
sd = socket(NET_SOCK_FAMILY, NET_SOCK_TYPE, NET_SOCK_PROTOCOL);
|
||||
if (sd < 0)
|
||||
{
|
||||
ret = -errno;
|
||||
|
Reference in New Issue
Block a user