Lines 532-551
Link Here
|
532 |
/* Do all cleanups that are normally done in nbio_poll */ |
532 |
/* Do all cleanups that are normally done in nbio_poll */ |
533 |
int nbio_cleanuponly(nbio_t *nb) |
533 |
int nbio_cleanuponly(nbio_t *nb) |
534 |
{ |
534 |
{ |
535 |
nbio_fd_t *cur = NULL, **prev = NULL; |
535 |
nbio_fd_t *cur = (nbio_fd_t *)nb->fdlist; |
536 |
|
536 |
|
537 |
for (prev = (nbio_fd_t **)&nb->fdlist; (cur = *prev); ) { |
537 |
while (cur) { |
538 |
|
538 |
|
539 |
if (cur->flags & NBIO_FDT_FLAG_CLOSED) { |
539 |
if (cur->flags & NBIO_FDT_FLAG_CLOSED) { |
540 |
*prev = cur->next; |
540 |
nbio_fd_t *prev = cur; |
541 |
__fdt_free(cur); |
541 |
cur = cur->next; |
|
|
542 |
__fdt_free(prev); |
542 |
continue; |
543 |
continue; |
543 |
} |
544 |
} |
544 |
|
545 |
|
545 |
if ((cur->flags & NBIO_FDT_FLAG_CLOSEONFLUSH) && !cur->txchain) |
546 |
if ((cur->flags & NBIO_FDT_FLAG_CLOSEONFLUSH) && !cur->txchain) |
546 |
cur->handler(nb, NBIO_EVENT_EOF, cur); |
547 |
cur->handler(nb, NBIO_EVENT_EOF, cur); |
547 |
|
548 |
|
548 |
prev = &cur->next; |
549 |
cur = cur->next; |
549 |
} |
550 |
} |
550 |
|
551 |
|
551 |
return 0; |
552 |
return 0; |