mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 16:30:41 +00:00
Fix previous change to compile again when using select() instead of poll().
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@35182 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
0687a031b1
commit
52e900d07c
2 changed files with 35 additions and 32 deletions
|
@ -1,3 +1,8 @@
|
|||
2012-06-07 Wolfgang Lux <wolfgang.lux@gmail.com>
|
||||
|
||||
* Source/unix/GSRunLoopCtxt.m (-pollUntil:within:): Fix previous
|
||||
change to compile again when using select() instead of poll().
|
||||
|
||||
2012-06-06 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/NSSocketPort.m:
|
||||
|
|
|
@ -398,8 +398,7 @@ static void setPollfd(int fd, int event, GSRunLoopCtxt *ctxt)
|
|||
{
|
||||
fd = port_fd_array[port_fd_count];
|
||||
setPollfd(fd, POLLIN, self);
|
||||
NSMapInsert(_rfdMap,
|
||||
(void*)(intptr_t)port_fd_array[port_fd_count], info);
|
||||
NSMapInsert(_rfdMap, (void*)(intptr_t)fd, info);
|
||||
}
|
||||
if (port_fd_array != port_fd_buffer) free(port_fd_array);
|
||||
}
|
||||
|
@ -507,13 +506,13 @@ static void setPollfd(int fd, int event, GSRunLoopCtxt *ctxt)
|
|||
}
|
||||
|
||||
/*
|
||||
* Look at all the file descriptors select() says are ready for action;
|
||||
* Look at all the file descriptors poll() says are ready for action;
|
||||
* notify the corresponding object for each of the ready fd's.
|
||||
* NB. It is possible for a watcher to be missing from the map - if
|
||||
* the event handler of a previous watcher has 'run' the loop again
|
||||
* before returning.
|
||||
* NB. Each time this loop is entered, the starting position (fairStart)
|
||||
* is incremented - this is to ensure a fair distribion over all
|
||||
* is incremented - this is to ensure a fair distribution over all
|
||||
* inputs where multiple inputs are in use. Note - fairStart can be
|
||||
* modified while we are in the loop (by recursive calls).
|
||||
*/
|
||||
|
@ -806,7 +805,7 @@ static void setPollfd(int fd, int event, GSRunLoopCtxt *ctxt)
|
|||
NSInteger port_fd_size = FDCOUNT;
|
||||
NSInteger port_fd_count = FDCOUNT;
|
||||
NSInteger port_fd_buffer[FDCOUNT];
|
||||
NSInteger port_fd_array = port_fd_count;
|
||||
NSInteger *port_fd_array = port_fd_buffer;
|
||||
|
||||
[port getFds: port_fd_array count: &port_fd_count];
|
||||
while (port_fd_count > port_fd_size)
|
||||
|
@ -822,11 +821,10 @@ static void setPollfd(int fd, int event, GSRunLoopCtxt *ctxt)
|
|||
while (port_fd_count--)
|
||||
{
|
||||
fd = port_fd_array[port_fd_count];
|
||||
FD_SET (port_fd_array[port_fd_count], &read_fds);
|
||||
if (fd > fdEnd)
|
||||
fdEnd = fd;
|
||||
NSMapInsert(_rfdMap,
|
||||
(void*)(intptr_t)port_fd_array[port_fd_count], info);
|
||||
FD_SET (fd, &read_fds);
|
||||
NSMapInsert(_rfdMap, (void*)(intptr_t)fd, info);
|
||||
}
|
||||
if (port_fd_array != port_fd_buffer) free(port_fd_array);
|
||||
}
|
||||
|
@ -928,8 +926,8 @@ static void setPollfd(int fd, int event, GSRunLoopCtxt *ctxt)
|
|||
/*
|
||||
* Look at all the file descriptors select() says are ready for action;
|
||||
* notify the corresponding object for each of the ready fd's.
|
||||
* NB. Each time this roop is entered, the starting position (fairStart)
|
||||
* is incremented - this is to ensure a fair distribtion over all
|
||||
* NB. Each time this loop is entered, the starting position (fairStart)
|
||||
* is incremented - this is to ensure a fair distribution over all
|
||||
* inputs where multiple inputs are in use. Note - fairStart can be
|
||||
* modified while we are in the loop (by recursive calls).
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue