From 069bb10a023faa31b280bfa8ca374171c6006f8a Mon Sep 17 00:00:00 2001 From: NAKAMURA Gou Date: Mon, 20 Jan 2014 15:57:11 +0900 Subject: [PATCH] make mcexec ignore garbage request When a signal is forwarded from McKernel, ioctl(MCEXEC_UP_WAIT_SYSCALL) may return EINTR error. In this case, though no syscall request has been received, the mcexec starts to process the syscall requst that is garbage. --- executer/user/mcexec.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/executer/user/mcexec.c b/executer/user/mcexec.c index edba2c80..9f9e403b 100644 --- a/executer/user/mcexec.c +++ b/executer/user/mcexec.c @@ -923,6 +923,10 @@ int main_loop(int fd, int cpu, pthread_mutex_t *lock) while (((ret = ioctl(fd, MCEXEC_UP_WAIT_SYSCALL, (unsigned long)&w)) == 0) || (ret == -1 && errno == EINTR)) { + if (ret) { + continue; + } + /* Don't print when got a msg to stdout */ if (!(w.sr.number == __NR_write && w.sr.args[0] == 1)) __dprintf("[%d] got syscall: %ld\n", cpu, w.sr.number);