From: Pierre-Marc Fournier Date: Tue, 9 Mar 2010 05:24:18 +0000 (-0500) Subject: ustd: handle all error codes from ustcomm_send_request X-Git-Tag: v0.4~27 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=5308038079d1b14a3fbaef282c39cced8444f5b3;p=ust.git ustd: handle all error codes from ustcomm_send_request Fixes a bug. --- diff --git a/ustd/ustd.c b/ustd/ustd.c index 4f82696..1144705 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; }