mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 00:30:53 +00:00
Workaround for some versions of egcs that can't cope with the FD_ZERO
declaration on Redhat 5.0 GNU/Linux. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@3740 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
399d9512d2
commit
e109b9acbc
3 changed files with 5 additions and 13 deletions
|
@ -72,10 +72,6 @@
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <string.h> /* for memset() */
|
#include <string.h> /* for memset() */
|
||||||
|
|
||||||
/* On some systems FD_ZERO is a macro that uses bzero().
|
|
||||||
Just define it to use memset(). */
|
|
||||||
#define bzero(PTR, LEN) memset (PTR, 0, LEN)
|
|
||||||
|
|
||||||
static int debug_run_loop = 0;
|
static int debug_run_loop = 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1089,8 +1085,8 @@ static int debug_run_loop = 0;
|
||||||
Initialize the set of FDS we'll pass to select(), and create
|
Initialize the set of FDS we'll pass to select(), and create
|
||||||
an empty map for keeping track of which object is associated
|
an empty map for keeping track of which object is associated
|
||||||
with which file descriptor. */
|
with which file descriptor. */
|
||||||
FD_ZERO (&fds);
|
memset(&fds, '\0', sizeof(fds));
|
||||||
FD_ZERO (&write_fds);
|
memset(&write_fds, '\0', sizeof(write_fds));
|
||||||
rfd_2_object = NSCreateMapTable (NSIntMapKeyCallBacks,
|
rfd_2_object = NSCreateMapTable (NSIntMapKeyCallBacks,
|
||||||
NSObjectMapValueCallBacks, 0);
|
NSObjectMapValueCallBacks, 0);
|
||||||
wfd_2_object = NSCreateMapTable (NSIntMapKeyCallBacks,
|
wfd_2_object = NSCreateMapTable (NSIntMapKeyCallBacks,
|
||||||
|
|
|
@ -83,10 +83,6 @@
|
||||||
#include <sys/errno.h>
|
#include <sys/errno.h>
|
||||||
#endif /* !__WIN32__ */
|
#endif /* !__WIN32__ */
|
||||||
|
|
||||||
/* On some systems FD_ZERO is a macro that uses bzero().
|
|
||||||
Just define it to use GCC's builtin memset(). */
|
|
||||||
#define bzero(PTR, LEN) memset (PTR, 0, LEN)
|
|
||||||
|
|
||||||
static int debug_tcp_port = 0;
|
static int debug_tcp_port = 0;
|
||||||
|
|
||||||
|
|
||||||
|
@ -204,7 +200,7 @@ tryRead(int desc, int tim, unsigned char* dat, int len)
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
to = &timeout;
|
to = &timeout;
|
||||||
FD_ZERO(&fds);
|
memset(&fds, '\0', sizeof(fds));
|
||||||
FD_SET(desc, &fds);
|
FD_SET(desc, &fds);
|
||||||
|
|
||||||
rval = select(FD_SETSIZE, &fds, 0, 0, to);
|
rval = select(FD_SETSIZE, &fds, 0, 0, to);
|
||||||
|
@ -289,7 +285,7 @@ tryWrite(int desc, int tim, unsigned char* dat, int len)
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
to = &timeout;
|
to = &timeout;
|
||||||
FD_ZERO(&fds);
|
memset(&fds, '\0', sizeof(fds));
|
||||||
FD_SET(desc, &fds);
|
FD_SET(desc, &fds);
|
||||||
|
|
||||||
rval = select(FD_SETSIZE, 0, &fds, 0, to);
|
rval = select(FD_SETSIZE, 0, &fds, 0, to);
|
||||||
|
|
|
@ -224,7 +224,7 @@ static NSMapTable *port_number_2_in_port = NULL;
|
||||||
|
|
||||||
timeout.tv_sec = milliseconds / 1000;
|
timeout.tv_sec = milliseconds / 1000;
|
||||||
timeout.tv_usec = (milliseconds % 1000) * 1000;
|
timeout.tv_usec = (milliseconds % 1000) * 1000;
|
||||||
FD_ZERO(&ready);
|
memset(&ready, '\0', sizeof(ready));
|
||||||
FD_SET(_port_socket, &ready);
|
FD_SET(_port_socket, &ready);
|
||||||
if ((r = select(_port_socket + 1, &ready, 0, 0, &timeout)) < 0)
|
if ((r = select(_port_socket + 1, &ready, 0, 0, &timeout)) < 0)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue