- /* Safety check on size */
- if (new_size > poll_max_size) {
- new_size = poll_max_size;
- }
-
- /* Check if we need to shrink it down. */
- if ((current->nb_fd << 1UL) <= current->alloc_size &&
- current->nb_fd >= current->init_size) {
- /*
- * Shrink if nb_fd multiplied by two is <= than the actual size and we
- * are above the initial size.
- */
- new_size = current->alloc_size >> 1UL;
- ret = resize_poll_event(current, new_size);
- if (ret < 0) {
- goto error;
- }
- events->need_realloc = 1;
- }
-