linux: fix infinite loop bug

master
insofaras 2016-06-16 23:50:45 +01:00
parent 7523900181
commit 35283aa36d
1 changed files with 8 additions and 12 deletions

View File

@ -2795,23 +2795,19 @@ main(int argc, char **argv)
case LINUX_4ED_EVENT_STEP: { case LINUX_4ED_EVENT_STEP: {
u64 ev; u64 ev;
while(read(linuxvars.step_event_fd, &ev, 8) == -1){ int ret;
if(errno != EINTR && errno != EAGAIN){ do {
perror("eventfd read"); ret = read(linuxvars.step_event_fd, &ev, 8);
break; } while(ret != -1 || errno != EAGAIN);
}
}
do_step = 1; do_step = 1;
} break; } break;
case LINUX_4ED_EVENT_STEP_TIMER: { case LINUX_4ED_EVENT_STEP_TIMER: {
u64 count; u64 count;
while(read(linuxvars.step_timer_fd, &count, 8) == -1){ int ret;
if(errno != EINTR && errno != EAGAIN){ do {
perror("timerfd read"); ret = read(linuxvars.step_timer_fd, &count, 8);
break; } while(ret != -1 || errno != EAGAIN);
}
}
do_step = 1; do_step = 1;
} break; } break;