mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 09:04:13 +00:00
[HAVE_POLL] (-pollUntil:within:): Set fdEnd to pollfds_count instead of setting it separately (which was being done incorrectly).
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@15920 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
cfd390dc45
commit
3767272175
2 changed files with 8 additions and 5 deletions
|
@ -1,3 +1,9 @@
|
|||
2003-02-10 13:56 Alexander Malmberg <alexander@malmberg.org>
|
||||
|
||||
* Source/NSRunLoop.m [HAVE_POLL] (-pollUntil:within:): Set fdEnd
|
||||
to pollfds_count instead of setting it separately (which was being
|
||||
done incorrectly).
|
||||
|
||||
2003-02-07 19:21 Alexander Malmberg <alexander@malmberg.org>
|
||||
|
||||
* Source/GSAttributedString (-setAttributes:range:): Fix memory
|
||||
|
|
|
@ -563,7 +563,7 @@ static void setPollfd(int fd, int event, GSRunLoopCtxt *ctxt)
|
|||
- (BOOL) pollUntil: (int)milliseconds within: (NSArray*)contexts
|
||||
{
|
||||
int poll_return;
|
||||
int fdEnd = 0; /* Number of descriptors being monitored. */
|
||||
int fdEnd; /* Number of descriptors being monitored. */
|
||||
int fdIndex;
|
||||
int fdFinish;
|
||||
unsigned int i;
|
||||
|
@ -614,21 +614,18 @@ static void setPollfd(int fd, int event, GSRunLoopCtxt *ctxt)
|
|||
fd = (int)info->data;
|
||||
setPollfd(fd, POLLPRI, self);
|
||||
NSMapInsert(_efdMap, (void*)fd, info);
|
||||
fdEnd++;
|
||||
break;
|
||||
|
||||
case ET_RDESC:
|
||||
fd = (int)info->data;
|
||||
setPollfd(fd, POLLIN, self);
|
||||
NSMapInsert(_rfdMap, (void*)fd, info);
|
||||
fdEnd++;
|
||||
break;
|
||||
|
||||
case ET_WDESC:
|
||||
fd = (int)info->data;
|
||||
setPollfd(fd, POLLOUT, self);
|
||||
NSMapInsert(_wfdMap, (void*)fd, info);
|
||||
fdEnd++;
|
||||
break;
|
||||
|
||||
case ET_RPORT:
|
||||
|
@ -660,7 +657,6 @@ static void setPollfd(int fd, int event, GSRunLoopCtxt *ctxt)
|
|||
setPollfd(fd, POLLIN, self);
|
||||
NSMapInsert(_rfdMap,
|
||||
(void*)port_fd_array[port_fd_count], info);
|
||||
fdEnd++;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -742,6 +738,7 @@ static void setPollfd(int fd, int event, GSRunLoopCtxt *ctxt)
|
|||
* inputs where multiple inputs are in use. Note - fairStart can be
|
||||
* modified while we are in the loop (by recursive calls).
|
||||
*/
|
||||
fdEnd = pollfds_count;
|
||||
if (++fairStart >= fdEnd)
|
||||
{
|
||||
fairStart = 0;
|
||||
|
|
Loading…
Reference in a new issue