[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 1/2] qemu-io: retry fgets() when errno is EINTR
From: |
MORITA Kazutaka |
Subject: |
[Qemu-devel] [PATCH 1/2] qemu-io: retry fgets() when errno is EINTR |
Date: |
Wed, 16 Jun 2010 02:53:40 +0900 |
posix-aio-compat sends a signal in aio operations, so we should
consider that fgets() could be interrupted here.
Signed-off-by: MORITA Kazutaka <address@hidden>
---
cmd.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/cmd.c b/cmd.c
index 2336334..460df92 100644
--- a/cmd.c
+++ b/cmd.c
@@ -272,7 +272,10 @@ fetchline(void)
return NULL;
printf("%s", get_prompt());
fflush(stdout);
+again:
if (!fgets(line, MAXREADLINESZ, stdin)) {
+ if (errno == EINTR)
+ goto again;
free(line);
return NULL;
}
--
1.5.6.5