From 5308038079d1b14a3fbaef282c39cced8444f5b3 Mon Sep 17 00:00:00 2001 From: Pierre-Marc Fournier Date: Tue, 9 Mar 2010 00:24:18 -0500 Subject: [PATCH] ustd: handle all error codes from ustcomm_send_request Fixes a bug. --- ustd/ustd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ustd/ustd.c b/ustd/ustd.c index 4f826966..1144705f 100644 --- a/ustd/ustd.c +++ b/ustd/ustd.c @@ -71,7 +71,7 @@ int get_subbuffer(struct buffer_info *buf) asprintf(&send_msg, "get_subbuffer %s", buf->name); result = ustcomm_send_request(&buf->conn, send_msg, &received_msg); - if((result == -1 && errno == EPIPE) || result == 0) { + if((result == -1 && (errno == ECONNRESET || errno == EPIPE)) || result == 0) { DBG("app died while being traced"); retval = GET_SUBBUF_DIED; goto end; @@ -131,7 +131,7 @@ int put_subbuffer(struct buffer_info *buf) asprintf(&send_msg, "put_subbuffer %s %ld", buf->name, buf->consumed_old); result = ustcomm_send_request(&buf->conn, send_msg, &received_msg); - if(result < 0 && errno == ECONNRESET) { + if(result < 0 && (errno == ECONNRESET || errno == EPIPE)) { retval = PUT_SUBBUF_DIED; goto end; } -- 2.34.1