improve error handling
authorPierre-Marc Fournier <pierre-marc.fournier@polymtl.ca>
Mon, 28 Sep 2009 23:45:47 +0000 (19:45 -0400)
committerPierre-Marc Fournier <pierre-marc.fournier@polymtl.ca>
Mon, 28 Sep 2009 23:45:47 +0000 (19:45 -0400)
libust/relay.c
libustcomm/ustcomm.c
ustd/ustd.c

index 05399b4a75787acb512eb30e09d6a721f80526a8..3259adee432da29fb1b063605b1d7bab01be3255 100644 (file)
@@ -101,7 +101,11 @@ static int relay_alloc_buf(struct rchan_buf *buf, size_t *size)
        *size = PAGE_ALIGN(*size);
 
        result = buf->shmid = shmget(getpid(), *size, IPC_CREAT | IPC_EXCL | 0700);
-       if(buf->shmid == -1) {
+       if(result == -1 && errno == EINVAL) {
+               ERR("shmget() returned EINVAL; maybe /proc/sys/kernel/shmmax should be increased.");
+               return -1;
+       }
+       else if(result == -1) {
                PERROR("shmget");
                return -1;
        }
index 8b459df32975499a4c1137ee379fb9d40600b231..2e490b56b7f3b9bde99a3db8ade8b66f99f090da 100644 (file)
@@ -406,7 +406,7 @@ int ustcomm_send_request(struct ustcomm_connection *conn, const char *req, char
 
        result = send(conn->fd, req, strlen(req), MSG_NOSIGNAL);
        if(result == -1) {
-               if(errno != ECONNRESET)
+               if(errno != EPIPE)
                        PERROR("send");
                return -1;
        }
@@ -506,7 +506,7 @@ int ustcomm_init_app(pid_t pid, struct ustcomm_app *handle)
 
        handle->server.listen_fd = init_named_socket(name, &(handle->server.socketpath));
        if(handle->server.listen_fd < 0) {
-               ERR("error initializing named socket");
+               ERR("Error initializing named socket (%s). Check that directory exists and that it is writable.", name);
                goto free_name;
        }
        free(name);
index 02abe5da99f2d41756114dee8ca155a86b3c0ce0..7d1eb49cec6de8d51157ca3c377a0d0be8d2318c 100644 (file)
@@ -112,11 +112,6 @@ int get_subbuffer(struct buffer_info *buf)
                retval = -1;
                goto end;
        }
-       else if(result == 0) {
-               DBG("app died while being traced");
-               retval = GET_SUBBUF_DIED;
-               goto end;
-       }
 
        result = sscanf(received_msg, "%as %ld", &rep_code, &buf->consumed_old);
        if(result != 2 && result != 1) {
This page took 0.026896 seconds and 4 git commands to generate.