From d46ff8e3963ed25d6b0cf99824855232eea1b1d0 Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Sat, 21 Oct 2017 19:54:00 +0200 Subject: [PATCH] redirect: Make sure example application does not exit on len==0 We want to continue running the event loop until it is exited properly, not if the callback for stdin detects a short read. Signed-off-by: Joachim Nilsson --- examples/redirect.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/redirect.c b/examples/redirect.c index 7f0cbbd..55621f8 100644 --- a/examples/redirect.c +++ b/examples/redirect.c @@ -36,7 +36,7 @@ void process_stdin(uev_t *w, void *arg, int events) if (len == 0) { fprintf(stderr, "Connection closed.\n"); - exit(0); + return; } fprintf(stdout, "--- read %d bytes\n", len);