summaryrefslogtreecommitdiffstats
path: root/apps/s_client.c
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2002-11-15 22:37:18 +0000
committerRichard Levitte <levitte@openssl.org>2002-11-15 22:37:18 +0000
commit0bf23d9b2055223c6e7a1398d2243a65dfa4c30d (patch)
treecd3b00d88ebc55c0ea232b6f43200097f20a16de /apps/s_client.c
parent813f256783a678b131a81ed1c8d05b70395a6255 (diff)
WinCE patches
Diffstat (limited to 'apps/s_client.c')
-rw-r--r--apps/s_client.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/apps/s_client.c b/apps/s_client.c
index 1b670aa4ee..3b018ff0e0 100644
--- a/apps/s_client.c
+++ b/apps/s_client.c
@@ -140,6 +140,14 @@ typedef unsigned int u_int;
#include <conio.h>
#endif
+#ifdef OPENSSL_SYS_WINCE
+/* Windows CE incorrectly defines fileno as returning void*, so to avoid problems below... */
+#ifdef fileno
+#undef fileno
+#endif
+#define fileno(a) (int)_fileno(a)
+#endif
+
#if (defined(OPENSSL_SYS_VMS) && __VMS_VER < 70000000)
/* FIONBIO used as a switch to enable ioctl, and that isn't in VMS < 7.0 */
@@ -662,7 +670,11 @@ re_start:
tv.tv_usec = 0;
i=select(width,(void *)&readfds,(void *)&writefds,
NULL,&tv);
+#ifdef OPENSSL_SYS_WINCE
+ if(!i && (!_kbhit() || !read_tty) ) continue;
+#else
if(!i && (!((_kbhit()) || (WAIT_OBJECT_0 == WaitForSingleObject(GetStdHandle(STD_INPUT_HANDLE), 0))) || !read_tty) ) continue;
+#endif
} else i=select(width,(void *)&readfds,(void *)&writefds,
NULL,NULL);
}
@@ -828,7 +840,11 @@ printf("read=%d pending=%d peek=%d\n",k,SSL_pending(con),SSL_peek(con,zbuf,10240
}
#ifdef OPENSSL_SYS_WINDOWS
+#ifdef OPENSSL_SYS_WINCE
+ else if (_kbhit())
+#else
else if ((_kbhit()) || (WAIT_OBJECT_0 == WaitForSingleObject(GetStdHandle(STD_INPUT_HANDLE), 0)))
+#endif
#else
else if (FD_ISSET(fileno(stdin),&readfds))
#endif