summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Torri <vincent.torri@gmail.com>2010-01-30 19:55:45 +0000
committerVincent Torri <vincent.torri@gmail.com>2010-01-30 19:55:45 +0000
commit65d13f2085ffab82d1421f6fbab5af1031e25959 (patch)
treedf7611363fd7c321e1f6c01d6858af11fe960d92
parent8498d88bc6cfb8f4f7d5a0b3473d8731082fea82 (diff)
* src/lib/evil_fcntl.c:
verify that the data passed to fcntl() is really a socket and fix ioctlsocket() returned value check. * src/bin/Makefile.am: * src/bin/evil_suite.c: add unit test for pipe(). SVN revision: 45736
-rw-r--r--legacy/evil/ChangeLog10
-rw-r--r--legacy/evil/src/bin/Makefile.am1
-rw-r--r--legacy/evil/src/bin/evil_suite.c2
-rw-r--r--legacy/evil/src/lib/evil_fcntl.c13
4 files changed, 24 insertions, 2 deletions
diff --git a/legacy/evil/ChangeLog b/legacy/evil/ChangeLog
index 24a73d9b15..2f16d88fdb 100644
--- a/legacy/evil/ChangeLog
+++ b/legacy/evil/ChangeLog
@@ -1,5 +1,15 @@
12010-01-30 Vincent Torri <doursse at users dot sf dot net> 12010-01-30 Vincent Torri <doursse at users dot sf dot net>
2 2
3 * src/lib/evil_fcntl.c:
4 verify that the data passed to fcntl() is really a socket
5 and fix ioctlsocket() returned value check.
6
7 * src/bin/Makefile.am:
8 * src/bin/evil_suite.c:
9 add unit test for pipe().
10
112010-01-30 Vincent Torri <doursse at users dot sf dot net>
12
3 * src/lib/Evil.h: 13 * src/lib/Evil.h:
4 change again the redefinition of open(). Needed 14 change again the redefinition of open(). Needed
5 for the gif loader. But the compilation with vc++ 15 for the gif loader. But the compilation with vc++
diff --git a/legacy/evil/src/bin/Makefile.am b/legacy/evil/src/bin/Makefile.am
index ac9bb5797a..ec3a4bb023 100644
--- a/legacy/evil/src/bin/Makefile.am
+++ b/legacy/evil/src/bin/Makefile.am
@@ -20,6 +20,7 @@ evil_test_gettimeofday.c \
20evil_test_link.c \ 20evil_test_link.c \
21evil_test_memcpy.c \ 21evil_test_memcpy.c \
22evil_test_mkstemp.c \ 22evil_test_mkstemp.c \
23evil_test_pipe.c \
23evil_test_realpath.c 24evil_test_realpath.c
24 25
25if EVIL_HAVE_WINCE 26if EVIL_HAVE_WINCE
diff --git a/legacy/evil/src/bin/evil_suite.c b/legacy/evil/src/bin/evil_suite.c
index 190362ebec..cee01cc95b 100644
--- a/legacy/evil/src/bin/evil_suite.c
+++ b/legacy/evil/src/bin/evil_suite.c
@@ -17,6 +17,7 @@
17#include "evil_test_link.h" 17#include "evil_test_link.h"
18#include "evil_test_memcpy.h" 18#include "evil_test_memcpy.h"
19#include "evil_test_mkstemp.h" 19#include "evil_test_mkstemp.h"
20#include "evil_test_pipe.h"
20#include "evil_test_realpath.h" 21#include "evil_test_realpath.h"
21 22
22 23
@@ -182,6 +183,7 @@ main()
182 { "gettimeofday", test_gettimeofday }, 183 { "gettimeofday", test_gettimeofday },
183 { "link ", test_link }, 184 { "link ", test_link },
184 { "mkstemp ", test_mkstemp }, 185 { "mkstemp ", test_mkstemp },
186 { "pipe ", test_pipe },
185 { "realpath ", test_realpath }, 187 { "realpath ", test_realpath },
186/* { "memcpy ", test_memcpy }, */ 188/* { "memcpy ", test_memcpy }, */
187 { NULL, NULL }, 189 { NULL, NULL },
diff --git a/legacy/evil/src/lib/evil_fcntl.c b/legacy/evil/src/lib/evil_fcntl.c
index 68618c528f..accc42c963 100644
--- a/legacy/evil/src/lib/evil_fcntl.c
+++ b/legacy/evil/src/lib/evil_fcntl.c
@@ -75,8 +75,17 @@ int fcntl(int fd, int cmd, ...)
75 if (flag == O_NONBLOCK) 75 if (flag == O_NONBLOCK)
76 { 76 {
77 u_long arg = 1; 77 u_long arg = 1;
78 if (ioctlsocket((SOCKET)fd, FIONBIO, &arg) == SOCKET_ERROR) 78 int type;
79 res = 0; 79 int len;
80 int ret;
81
82 len = (int)sizeof(int);
83 ret = getsockopt((SOCKET)fd, SOL_SOCKET, SO_TYPE, (char *)&type, &len);
84 if (!ret && (type == SOCK_STREAM))
85 {
86 if (!ioctlsocket((SOCKET)fd, FIONBIO, &arg) == SOCKET_ERROR)
87 res = 0;
88 }
80 } 89 }
81 } 90 }
82#if ! ( defined(__CEGCC__) || defined(__MINGW32CE__) ) 91#if ! ( defined(__CEGCC__) || defined(__MINGW32CE__) )