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 | 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 | 45 | #include <lib3270/config.h> |
41 | 46 | #if defined(HAVE_LIBSSL) |
42 | 47 | #include <openssl/ssl.h> |
... | ... | @@ -47,7 +52,6 @@ |
47 | 52 | #include <errno.h> |
48 | 53 | |
49 | 54 | #if defined(_WIN32) |
50 | - #include <winsock2.h> | |
51 | 55 | #include <ws2tcpip.h> |
52 | 56 | #else |
53 | 57 | #include <sys/socket.h> |
... | ... | @@ -3163,6 +3167,18 @@ net_snap_options(void) |
3163 | 3167 | */ |
3164 | 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 | 3182 | int f; |
3167 | 3183 | |
3168 | 3184 | if ((f = fcntl(session->sock, F_GETFL, 0)) == -1) |
... | ... | @@ -3182,6 +3198,8 @@ static int non_blocking(H3270 *session, Boolean on) |
3182 | 3198 | return -1; |
3183 | 3199 | } |
3184 | 3200 | |
3201 | +#endif // FIONBIO | |
3202 | + | |
3185 | 3203 | return 0; |
3186 | 3204 | } |
3187 | 3205 | ... | ... |