Commit 886d59dd06bbc9af8adbd40f3d3d46511b608723
1 parent
6fccf19e
Exists in
master
and in
3 other branches
Implementando win64
Showing
1 changed file
with
19 additions
and
1 deletions
Show diff stats
telnet.c
@@ -37,6 +37,11 @@ | @@ -37,6 +37,11 @@ | ||
37 | * the given IBM host. | 37 | * the given IBM host. |
38 | */ | 38 | */ |
39 | 39 | ||
40 | +#if defined(_WIN32) | ||
41 | + #include <winsock2.h> | ||
42 | + #include <windows.h> | ||
43 | +#endif | ||
44 | + | ||
40 | #include <lib3270/config.h> | 45 | #include <lib3270/config.h> |
41 | #if defined(HAVE_LIBSSL) | 46 | #if defined(HAVE_LIBSSL) |
42 | #include <openssl/ssl.h> | 47 | #include <openssl/ssl.h> |
@@ -47,7 +52,6 @@ | @@ -47,7 +52,6 @@ | ||
47 | #include <errno.h> | 52 | #include <errno.h> |
48 | 53 | ||
49 | #if defined(_WIN32) | 54 | #if defined(_WIN32) |
50 | - #include <winsock2.h> | ||
51 | #include <ws2tcpip.h> | 55 | #include <ws2tcpip.h> |
52 | #else | 56 | #else |
53 | #include <sys/socket.h> | 57 | #include <sys/socket.h> |
@@ -3163,6 +3167,18 @@ net_snap_options(void) | @@ -3163,6 +3167,18 @@ net_snap_options(void) | ||
3163 | */ | 3167 | */ |
3164 | static int non_blocking(H3270 *session, Boolean on) | 3168 | static int non_blocking(H3270 *session, Boolean on) |
3165 | { | 3169 | { |
3170 | +# if defined(FIONBIO) | ||
3171 | + | ||
3172 | + int i = on ? 1 : 0; | ||
3173 | + | ||
3174 | + if (SOCK_IOCTL(session->sock, FIONBIO, (int *) &i) < 0) | ||
3175 | + { | ||
3176 | + popup_a_sockerr(session, N_( "ioctl(%s)" ), "FIONBIO"); | ||
3177 | + return -1; | ||
3178 | + } | ||
3179 | + | ||
3180 | +#else | ||
3181 | + | ||
3166 | int f; | 3182 | int f; |
3167 | 3183 | ||
3168 | if ((f = fcntl(session->sock, F_GETFL, 0)) == -1) | 3184 | if ((f = fcntl(session->sock, F_GETFL, 0)) == -1) |
@@ -3182,6 +3198,8 @@ static int non_blocking(H3270 *session, Boolean on) | @@ -3182,6 +3198,8 @@ static int non_blocking(H3270 *session, Boolean on) | ||
3182 | return -1; | 3198 | return -1; |
3183 | } | 3199 | } |
3184 | 3200 | ||
3201 | +#endif // FIONBIO | ||
3202 | + | ||
3185 | return 0; | 3203 | return 0; |
3186 | } | 3204 | } |
3187 | 3205 |