Commit 476de7eb authored by Pekka Pessi's avatar Pekka Pessi
Browse files

su_port.c, su_wait.c: fixed typos looping through pollfd.

darcs-hash:20060926224302-65a35-5ca150bce89b823f254b50cca2d88ede7e665fb6.gz
parent 42204eb6
...@@ -1171,7 +1171,7 @@ int su_port_wait_events(su_port_t *self, su_duration_t tout) ...@@ -1171,7 +1171,7 @@ int su_port_wait_events(su_port_t *self, su_duration_t tout)
/* poll() can return events for multiple wait objects */ /* poll() can return events for multiple wait objects */
if (self->sup_multishot) { if (self->sup_multishot) {
unsigned j; unsigned j;
for (j = (unsigned)i; j < n; i++) { for (j = (unsigned)i; j < n; j++) {
if (waits[j].revents) { if (waits[j].revents) {
root = self->sup_wait_roots[j]; root = self->sup_wait_roots[j];
self->sup_wait_cbs[j](root ? su_root_magic(root) : NULL, self->sup_wait_cbs[j](root ? su_root_magic(root) : NULL,
......
...@@ -218,14 +218,14 @@ int su_wait(su_wait_t waits[], unsigned n, su_duration_t timeout) ...@@ -218,14 +218,14 @@ int su_wait(su_wait_t waits[], unsigned n, su_duration_t timeout)
#elif SU_HAVE_POLL #elif SU_HAVE_POLL
for (;;) { for (;;) {
unsigned j;
int i = poll(waits, n, timeout); int i = poll(waits, n, timeout);
if (i == 0) if (i == 0)
return SU_WAIT_TIMEOUT; return SU_WAIT_TIMEOUT;
if (i > 0) { if (i > 0) {
for (j = 0; j < n; i++) { unsigned j;
for (j = 0; j < n; j++) {
if (waits[j].revents) if (waits[j].revents)
return (int)j; return (int)j;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment