forked from enlightenment/efl
* src/lib/evil_fcntl.c:
* src/lib/evil_fcntl.h: * src/lib/evil_unistd.c: make pipe() blocking by default and allow fcntl() to set a socket to be non-blocking * src/lib/evil_stdlib.c: fix warning SVN revision: 45698
This commit is contained in:
parent
0aec2b4dcd
commit
29db27970c
|
@ -1,3 +1,14 @@
|
||||||
|
2010-01-29 Vincent Torri <doursse at users dot sf dot net>
|
||||||
|
|
||||||
|
* src/lib/evil_fcntl.c:
|
||||||
|
* src/lib/evil_fcntl.h:
|
||||||
|
* src/lib/evil_unistd.c:
|
||||||
|
make pipe() blocking by default and allow fcntl()
|
||||||
|
to set a socket to be non-blocking
|
||||||
|
|
||||||
|
* src/lib/evil_stdlib.c:
|
||||||
|
fix warning
|
||||||
|
|
||||||
2010-01-19 Vincent Torri <doursse at users dot sf dot net>
|
2010-01-19 Vincent Torri <doursse at users dot sf dot net>
|
||||||
|
|
||||||
* src/lib/dlfcn/dlfcn.c:
|
* src/lib/dlfcn/dlfcn.c:
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
# include "config.h"
|
||||||
|
#endif /* HAVE_CONFIG_H */
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
|
@ -9,9 +13,7 @@
|
||||||
# include <sys/locking.h>
|
# include <sys/locking.h>
|
||||||
#endif /* __CEGCC__ */
|
#endif /* __CEGCC__ */
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#include <winsock2.h> /* for ioctlsocket */
|
||||||
# include "config.h"
|
|
||||||
#endif /* HAVE_CONFIG_H */
|
|
||||||
|
|
||||||
#include "Evil.h"
|
#include "Evil.h"
|
||||||
|
|
||||||
|
@ -64,6 +66,12 @@ int fcntl(int fd, int cmd, ...)
|
||||||
res = 0;
|
res = 0;
|
||||||
#endif /* __CEGCC__ || __MINGW32CE__ */
|
#endif /* __CEGCC__ || __MINGW32CE__ */
|
||||||
}
|
}
|
||||||
|
if (flag == O_NONBLOCK)
|
||||||
|
{
|
||||||
|
u_long arg = 1;
|
||||||
|
if (ioctlsocket((SOCKET)fd, FIONBIO, &arg) == SOCKET_ERROR)
|
||||||
|
res = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#if ! ( defined(__CEGCC__) || defined(__MINGW32CE__) )
|
#if ! ( defined(__CEGCC__) || defined(__MINGW32CE__) )
|
||||||
else if ((cmd == F_SETLK) || (cmd == F_SETLKW))
|
else if ((cmd == F_SETLK) || (cmd == F_SETLKW))
|
||||||
|
|
|
@ -13,6 +13,12 @@
|
||||||
*/
|
*/
|
||||||
# define FD_CLOEXEC 1
|
# define FD_CLOEXEC 1
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @def O_NONBLOCK
|
||||||
|
* Specifies that the socket is in non-blocking mode.
|
||||||
|
*/
|
||||||
|
# define O_NONBLOCK 04000
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @def F_SETFD
|
* @def F_SETFD
|
||||||
* Specifies that fcntl() should set the file descriptor flags
|
* Specifies that fcntl() should set the file descriptor flags
|
||||||
|
|
|
@ -322,7 +322,7 @@ mkstemp(char *__template)
|
||||||
|
|
||||||
#if ! ( defined(__CEGCC__) || defined(__MINGW32CE__) )
|
#if ! ( defined(__CEGCC__) || defined(__MINGW32CE__) )
|
||||||
fd = _open(__template, _O_RDWR | _O_BINARY | _O_CREAT | _O_EXCL, _S_IREAD | _S_IWRITE);
|
fd = _open(__template, _O_RDWR | _O_BINARY | _O_CREAT | _O_EXCL, _S_IREAD | _S_IWRITE);
|
||||||
#else /* __CEGCC__ || __MINGW32CE__ */
|
#else /* _WIN32_WCE */
|
||||||
{
|
{
|
||||||
FILE *f;
|
FILE *f;
|
||||||
wchar_t *wtemplate;
|
wchar_t *wtemplate;
|
||||||
|
@ -339,9 +339,9 @@ mkstemp(char *__template)
|
||||||
#endif /* HAVE_ERRNO_H */
|
#endif /* HAVE_ERRNO_H */
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
fd = _fileno(f);
|
fd = (int)_fileno(f);
|
||||||
}
|
}
|
||||||
#endif /* __CEGCC__ || __MINGW32CE__ */
|
#endif /* _WIN32_WCE */
|
||||||
if (fd >= 0)
|
if (fd >= 0)
|
||||||
return fd;
|
return fd;
|
||||||
|
|
||||||
|
|
|
@ -382,11 +382,11 @@ evil_pipe(int *fds)
|
||||||
if (!FD_ISSET (socket1, &write_set))
|
if (!FD_ISSET (socket1, &write_set))
|
||||||
goto out2;
|
goto out2;
|
||||||
|
|
||||||
arg = 1;
|
arg = 0;
|
||||||
if (ioctlsocket (socket1, FIONBIO, &arg) == SOCKET_ERROR)
|
if (ioctlsocket (socket1, FIONBIO, &arg) == SOCKET_ERROR)
|
||||||
goto out2;
|
goto out2;
|
||||||
|
|
||||||
arg = 1;
|
arg = 0;
|
||||||
if (ioctlsocket (socket2, FIONBIO, &arg) == SOCKET_ERROR)
|
if (ioctlsocket (socket2, FIONBIO, &arg) == SOCKET_ERROR)
|
||||||
goto out2;
|
goto out2;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue