updated the default definition of moo_sa_family_t

This commit is contained in:
hyunghwan.chung
2018-01-19 13:29:15 +00:00
parent d3a57db467
commit 9a49b4fa53
4 changed files with 48 additions and 5 deletions

View File

@ -103,9 +103,9 @@ struct sck_t
#endif
#else
# undef MOO_SIZEOF_SA_FAMILY_T
# define MOO_SIZEOF_SA_FAMILY_T MOO_SIZEOF_INT
# define MOO_SA_FAMILY_T_IS_SIGNED
typedef int sck_addr_family_t;
# define MOO_SIZEOF_SA_FAMILY_T MOO_SIZEOF_SHORT
# undef MOO_SA_FAMILY_T_IS_SIGNED
typedef unsigned short int sck_addr_family_t;
#endif
struct sck_addr_t

View File

@ -63,6 +63,7 @@ static moo_pfrc_t pf_open_socket (moo_t* moo, moo_ooi_t nargs)
typev |= SOCK_NONBLOCK | SOCK_CLOEXEC;
create_socket:
#endif
fd = socket (MOO_OOP_TO_SMOOI(dom), typev, MOO_OOP_TO_SMOOI(proto));
if (fd == -1)
{
@ -324,7 +325,7 @@ static moo_pfrc_t pf_connect (moo_t* moo, moo_ooi_t nargs)
n = connect(fd, (struct sockaddr*)MOO_OBJ_GET_BYTE_SLOT(arg), moo_sck_addr_len((sck_addr_t*)MOO_OBJ_GET_BYTE_SLOT(arg)));
}
while (n == -1 && errno == EINTR);
if (n == -1 && errno != EINPROGRESS)
{
moo_seterrwithsyserr (moo, errno);