Changeset 3621 in MondoRescue for branches/3.3/mindi-busybox/libbb/read_printf.c
- Timestamp:
- Dec 20, 2016, 4:07:32 PM (7 years ago)
- Location:
- branches/3.3
- Files:
-
- 1 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/3.3/mindi-busybox/libbb/read_printf.c
r3232 r3621 46 46 * Thankfully, poll() doesn't care about O_NONBLOCK flag. 47 47 */ 48 ssize_t FAST_FUNC nonblock_immune_read(int fd, void *buf, size_t count , int loop_on_EINTR)48 ssize_t FAST_FUNC nonblock_immune_read(int fd, void *buf, size_t count) 49 49 { 50 50 struct pollfd pfd[1]; … … 52 52 53 53 while (1) { 54 n = loop_on_EINTR ? safe_read(fd, buf, count) :read(fd, buf, count);54 n = safe_read(fd, buf, count); 55 55 if (n >= 0 || errno != EAGAIN) 56 56 return n; … … 59 59 pfd[0].events = POLLIN; 60 60 /* note: safe_poll pulls in printf */ 61 loop_on_EINTR ? safe_poll(pfd, 1, -1) :poll(pfd, 1, -1);61 safe_poll(pfd, 1, -1); 62 62 } 63 63 } … … 82 82 sz += 128; 83 83 } 84 if (nonblock_immune_read(fd, p, 1 , /*loop_on_EINTR:*/ 1) != 1) {84 if (nonblock_immune_read(fd, p, 1) != 1) { 85 85 /* EOF/error */ 86 86 if (p == buf) { /* we read nothing */
Note:
See TracChangeset
for help on using the changeset viewer.