Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
ret_len = send(ctx->control_sock, &cmd, sizeof(cmd), 0);
} while (ret_len < 0 && errno == EINTR);
if (ret_len < 0) {
ret_len = send(ctx->control_sock, &cmd, sizeof(cmd), 0);
} while (ret_len < 0 && errno == EINTR);
if (ret_len < 0) {
- fprintf(stderr, "[error] Error sending cmd\n");
+ perror("[error] Error sending cmd");
ret = ret_len;
goto error;
}
ret = ret_len;
goto error;
}
ret_len = send(ctx->control_sock, &connect, sizeof(connect), 0);
} while (ret_len < 0 && errno == EINTR);
if (ret_len < 0) {
ret_len = send(ctx->control_sock, &connect, sizeof(connect), 0);
} while (ret_len < 0 && errno == EINTR);
if (ret_len < 0) {
- fprintf(stderr, "[error] Error sending version\n");
+ perror("[error] Error sending version");
ret = ret_len;
goto error;
}
ret = ret_len;
goto error;
}
goto error;
}
if (ret_len < 0) {
goto error;
}
if (ret_len < 0) {
- fprintf(stderr, "[error] Error receiving version\n");
+ perror("[error] Error receiving version");
ret = ret_len;
goto error;
}
ret = ret_len;
goto error;
}
ret_len = send(ctx->control_sock, &cmd, sizeof(cmd), 0);
} while (ret_len < 0 && errno == EINTR);
if (ret_len < 0) {
ret_len = send(ctx->control_sock, &cmd, sizeof(cmd), 0);
} while (ret_len < 0 && errno == EINTR);
if (ret_len < 0) {
- fprintf(stderr, "[error] Error sending cmd\n");
+ perror("[error] Error sending cmd");
ret = ret_len;
goto error;
}
ret = ret_len;
goto error;
}
goto error;
}
if (ret_len < 0) {
goto error;
}
if (ret_len < 0) {
- fprintf(stderr, "[error] Error receiving session list\n");
+ perror("[error] Error receiving session list");
ret = ret_len;
goto error;
}
ret = ret_len;
goto error;
}
goto error;
}
if (ret_len < 0) {
goto error;
}
if (ret_len < 0) {
- fprintf(stderr, "[error] Error receiving session\n");
+ perror("[error] Error receiving session");
ret = ret_len;
goto error;
}
ret = ret_len;
goto error;
}
ret_len = send(ctx->control_sock, &cmd, sizeof(cmd), 0);
} while (ret_len < 0 && errno == EINTR);
if (ret_len < 0) {
ret_len = send(ctx->control_sock, &cmd, sizeof(cmd), 0);
} while (ret_len < 0 && errno == EINTR);
if (ret_len < 0) {
- fprintf(stderr, "[error] Error sending cmd\n");
+ perror("[error] Error sending cmd");
ret = ret_len;
goto error;
}
ret = ret_len;
goto error;
}
ret_len = send(ctx->control_sock, &rq, sizeof(rq), 0);
} while (ret_len < 0 && errno == EINTR);
if (ret_len < 0) {
ret_len = send(ctx->control_sock, &rq, sizeof(rq), 0);
} while (ret_len < 0 && errno == EINTR);
if (ret_len < 0) {
- fprintf(stderr, "[error] Error sending attach request\n");
+ perror("[error] Error sending attach request");
ret = ret_len;
goto error;
}
ret = ret_len;
goto error;
}
goto error;
}
if (ret_len < 0) {
goto error;
}
if (ret_len < 0) {
- fprintf(stderr, "[error] Error receiving attach response\n");
+ perror("[error] Error receiving attach response");
ret = ret_len;
goto error;
}
ret = ret_len;
goto error;
}
ret = -LTTNG_VIEWER_ATTACH_UNK;
goto end;
case LTTNG_VIEWER_ATTACH_ALREADY:
ret = -LTTNG_VIEWER_ATTACH_UNK;
goto end;
case LTTNG_VIEWER_ATTACH_ALREADY:
- fprintf(stderr, "[error] Already a viewer attached\n");
+ fprintf(stderr, "[error] There is already a viewer attached to this session\n");
ret = -1;
goto end;
case LTTNG_VIEWER_ATTACH_NOT_LIVE:
ret = -1;
goto end;
case LTTNG_VIEWER_ATTACH_NOT_LIVE:
goto error;
}
if (ret_len < 0) {
goto error;
}
if (ret_len < 0) {
- fprintf(stderr, "[error] Error receiving stream\n");
+ perror("[error] Error receiving stream");
ret = ret_len;
goto error;
}
ret = ret_len;
goto error;
}
ret_len = send(ctx->control_sock, &cmd, sizeof(cmd), 0);
} while (ret_len < 0 && errno == EINTR);
if (ret_len < 0) {
ret_len = send(ctx->control_sock, &cmd, sizeof(cmd), 0);
} while (ret_len < 0 && errno == EINTR);
if (ret_len < 0) {
- fprintf(stderr, "[error] Error sending cmd\n");
+ perror("[error] Error sending cmd");
ret = ret_len;
goto error;
}
ret = ret_len;
goto error;
}
ret_len = send(ctx->control_sock, &rq, sizeof(rq), 0);
} while (ret_len < 0 && errno == EINTR);
if (ret_len < 0) {
ret_len = send(ctx->control_sock, &rq, sizeof(rq), 0);
} while (ret_len < 0 && errno == EINTR);
if (ret_len < 0) {
- fprintf(stderr, "[error] Error sending get_data_packet request\n");
+ perror("[error] Error sending get_data_packet request");
ret = ret_len;
goto error;
}
ret = ret_len;
goto error;
}
goto error;
}
if (ret_len < 0) {
goto error;
}
if (ret_len < 0) {
- fprintf(stderr, "[error] Error receiving data response\n");
+ perror("[error] Error receiving data response");
ret = ret_len;
goto error;
}
ret = ret_len;
goto error;
}
/* unmap old base */
ret = munmap_align(pos->base_mma);
if (ret) {
/* unmap old base */
ret = munmap_align(pos->base_mma);
if (ret) {
- fprintf(stderr, "[error] Unable to unmap old base: %s.\n",
- strerror(errno));
+ perror("[error] Unable to unmap old base");
PROT_READ | PROT_WRITE,
MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (pos->base_mma == MAP_FAILED) {
PROT_READ | PROT_WRITE,
MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (pos->base_mma == MAP_FAILED) {
- fprintf(stderr, "[error] mmap error %s.\n",
- strerror(errno));
+ perror("[error] mmap error");
pos->base_mma = NULL;
ret = -1;
goto error;
pos->base_mma = NULL;
ret = -1;
goto error;
goto error;
}
if (ret_len < 0) {
goto error;
}
if (ret_len < 0) {
- fprintf(stderr, "[error] Error receiving trace packet\n");
+ perror("[error] Error receiving trace packet");
ret = ret_len;
goto error;
}
ret = ret_len;
goto error;
}
ret_len = send(ctx->control_sock, &cmd, sizeof(cmd), 0);
} while (ret_len < 0 && errno == EINTR);
if (ret_len < 0) {
ret_len = send(ctx->control_sock, &cmd, sizeof(cmd), 0);
} while (ret_len < 0 && errno == EINTR);
if (ret_len < 0) {
- fprintf(stderr, "[error] Error sending cmd\n");
+ perror("[error] Error sending cmd");
ret = ret_len;
goto error;
}
ret = ret_len;
goto error;
}
ret_len = send(ctx->control_sock, &rq, sizeof(rq), 0);
} while (ret_len < 0 && errno == EINTR);
if (ret_len < 0) {
ret_len = send(ctx->control_sock, &rq, sizeof(rq), 0);
} while (ret_len < 0 && errno == EINTR);
if (ret_len < 0) {
- fprintf(stderr, "[error] Error sending get_metadata request\n");
+ perror("[error] Error sending get_metadata request");
ret = ret_len;
goto error;
}
ret = ret_len;
goto error;
}
goto error;
}
if (ret_len < 0) {
goto error;
}
if (ret_len < 0) {
- fprintf(stderr, "[error] Error receiving metadata response\n");
+ perror("[error] Error receiving metadata response");
ret = ret_len;
goto error;
}
ret = ret_len;
goto error;
}
goto error;
}
if (ret_len < 0) {
goto error;
}
if (ret_len < 0) {
- fprintf(stderr, "[error] Error receiving trace packet\n");
+ perror("[error] Error receiving trace packet");
ret = ret_len;
free(data);
goto error;
ret = ret_len;
free(data);
goto error;
ret_len = send(ctx->control_sock, &cmd, sizeof(cmd), 0);
} while (ret_len < 0 && errno == EINTR);
if (ret_len < 0) {
ret_len = send(ctx->control_sock, &cmd, sizeof(cmd), 0);
} while (ret_len < 0 && errno == EINTR);
if (ret_len < 0) {
- fprintf(stderr, "[error] Error sending cmd\n");
+ perror("[error] Error sending cmd");
ret = ret_len;
goto error;
}
ret = ret_len;
goto error;
}
ret_len = send(ctx->control_sock, &rq, sizeof(rq), 0);
} while (ret_len < 0 && errno == EINTR);
if (ret_len < 0) {
ret_len = send(ctx->control_sock, &rq, sizeof(rq), 0);
} while (ret_len < 0 && errno == EINTR);
if (ret_len < 0) {
- fprintf(stderr, "[error] Error sending get_next_index request\n");
+ perror("[error] Error sending get_next_index request");
ret = ret_len;
goto error;
}
ret = ret_len;
goto error;
}
goto error;
}
if (ret_len < 0) {
goto error;
}
if (ret_len < 0) {
- fprintf(stderr, "[error] Error receiving index response\n");
+ perror("[error] Error receiving index response");
ret = ret_len;
goto error;
}
ret = ret_len;
goto error;
}
ret_len = send(ctx->control_sock, &cmd, sizeof(cmd), 0);
} while (ret_len < 0 && errno == EINTR);
if (ret_len < 0) {
ret_len = send(ctx->control_sock, &cmd, sizeof(cmd), 0);
} while (ret_len < 0 && errno == EINTR);
if (ret_len < 0) {
- fprintf(stderr, "[error] Error sending cmd\n");
+ perror("[error] Error sending cmd");
ret = ret_len;
goto error;
}
ret = ret_len;
goto error;
}
goto error;
}
if (ret_len < 0) {
goto error;
}
if (ret_len < 0) {
- fprintf(stderr, "[error] Error receiving create session reply\n");
+ perror("[error] Error receiving create session reply");
ret = ret_len;
goto error;
}
ret = ret_len;
goto error;
}
ret_len = send(ctx->control_sock, &cmd, sizeof(cmd), 0);
} while (ret_len < 0 && errno == EINTR);
if (ret_len < 0) {
ret_len = send(ctx->control_sock, &cmd, sizeof(cmd), 0);
} while (ret_len < 0 && errno == EINTR);
if (ret_len < 0) {
- fprintf(stderr, "[error] Error sending cmd\n");
+ perror("[error] Error sending cmd");
ret = ret_len;
goto error;
}
ret = ret_len;
goto error;
}
ret_len = send(ctx->control_sock, &rq, sizeof(rq), 0);
} while (ret_len < 0 && errno == EINTR);
if (ret_len < 0) {
ret_len = send(ctx->control_sock, &rq, sizeof(rq), 0);
} while (ret_len < 0 && errno == EINTR);
if (ret_len < 0) {
- fprintf(stderr, "[error] Error sending get_new_streams request\n");
+ perror("[error] Error sending get_new_streams request");
ret = ret_len;
goto error;
}
ret = ret_len;
goto error;
}
goto error;
}
if (ret_len < 0) {
goto error;
}
if (ret_len < 0) {
- fprintf(stderr, "[error] Error receiving get_new_streams response\n");
+ perror("[error] Error receiving get_new_streams response");
ret = ret_len;
goto error;
}
ret = ret_len;
goto error;
}
goto error;
}
if (ret_len < 0) {
goto error;
}
if (ret_len < 0) {
- fprintf(stderr, "[error] Error receiving stream\n");
+ perror("[error] Error receiving stream");
ret = ret_len;
goto error;
}
ret = ret_len;
goto error;
}