123456789101112131415161718192021222324252627282930313233 |
- #include "libbb.h"
- int FAST_FUNC safe_poll(struct pollfd *ufds, nfds_t nfds, int timeout)
- {
- while (1) {
- int n = poll(ufds, nfds, timeout);
- if (n >= 0)
- return n;
-
- if (timeout > 0)
- timeout--;
-
- if (errno == EINTR)
- continue;
-
-
- if (errno == ENOMEM)
- continue;
- bb_perror_msg("poll");
- return n;
- }
- }
|