[Sheepdog] [PATCH 3/5] collie vdi write: stop trying to read STDIN on EOF

Chris Webb chris at arachsys.com
Sat Aug 13 12:56:20 CEST 2011


Signed-off-by: Chris Webb <chris at arachsys.com>
---
 collie/vdi.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/collie/vdi.c b/collie/vdi.c
index 204e13a..6b2f26c 100644
--- a/collie/vdi.c
+++ b/collie/vdi.c
@@ -1113,7 +1113,9 @@ static int vdi_write(int argc, char **argv)
 		}
 
 		ret = read(STDIN_FILENO, buf, len);
-		if (ret < 0) {
+		if (ret == 0)
+			break;
+		else if (ret < 0) {
 			fprintf(stderr, "%m\n");
 			ret = EXIT_SYSFAIL;
 			goto out;
-- 
1.7.5.4




More information about the sheepdog mailing list