ustd: handle all error codes from ustcomm_send_request
authorPierre-Marc Fournier <pierre-marc.fournier@polymtl.ca>
Tue, 9 Mar 2010 05:24:18 +0000 (00:24 -0500)
committerPierre-Marc Fournier <pierre-marc.fournier@polymtl.ca>
Tue, 9 Mar 2010 05:24:18 +0000 (00:24 -0500)
Fixes a bug.

ustd/ustd.c

index 4f826966dd3900ba1da0ce9211d273e3697c070f..1144705fec00d0eaaf29bdc13d4471ada0bb4f6f 100644 (file)
@@ -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;
        }
This page took 0.025696 seconds and 4 git commands to generate.