mirror of
https://github.com/lsalzman/enet
synced 2024-11-21 06:25:59 -07:00
more ENET_SOCKOPT_ERROR fixes
This commit is contained in:
parent
3595c0b3fb
commit
c0713c47e6
2 changed files with 6 additions and 3 deletions
4
unix.c
4
unix.c
|
@ -275,10 +275,12 @@ int
|
|||
enet_socket_get_option (ENetSocket socket, ENetSocketOption option, int * value)
|
||||
{
|
||||
int result = -1;
|
||||
socklen_t len;
|
||||
switch (option)
|
||||
{
|
||||
case ENET_SOCKOPT_ERROR:
|
||||
result = getsockopt (socket, SOL_SOCKET, SO_ERROR, (char *) value, sizeof (int));
|
||||
len = sizeof (int);
|
||||
result = getsockopt (socket, SOL_SOCKET, SO_ERROR, value, & len);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
5
win32.c
5
win32.c
|
@ -204,11 +204,12 @@ enet_socket_set_option (ENetSocket socket, ENetSocketOption option, int value)
|
|||
int
|
||||
enet_socket_get_option (ENetSocket socket, ENetSocketOption option, int * value)
|
||||
{
|
||||
int result = SOCKET_ERROR;
|
||||
int result = SOCKET_ERROR, len;
|
||||
switch (option)
|
||||
{
|
||||
case ENET_SOCKOPT_ERROR:
|
||||
result = getsockopt (socket, SOL_SOCKET, SO_ERROR, (char *) value, sizeof (int));
|
||||
len = sizeof(int);
|
||||
result = getsockopt (socket, SOL_SOCKET, SO_ERROR, (char *) value, & len);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
Loading…
Reference in a new issue