do {
ret = write(wpipe, "!", 1);
} while (ret < 0 && errno == EINTR);
- if (ret < 0) {
+ if (ret < 0 || ret != 1) {
PERROR("write poll pipe");
}
sizeof(struct relay_command));
} while (ret < 0 && errno == EINTR);
free(relay_cmd);
- if (ret < 0) {
+ if (ret < 0 || ret != sizeof(struct relay_command)) {
PERROR("write cmd pipe");
goto error;
}
send_ret = cmd->sock->ops->sendmsg(cmd->sock, &reply, sizeof(reply), 0);
if (send_ret < 0) {
ERR("Relayd sending session id");
+ ret = send_ret;
}
return ret;
goto end_no_session;
}
- /* FIXME : use data_size for something ? */
ret = cmd->sock->ops->recvmsg(cmd->sock, &stream_info,
sizeof(struct lttcomm_relayd_add_stream), 0);
if (ret < sizeof(struct lttcomm_relayd_add_stream)) {
sizeof(struct lttcomm_relayd_status_stream), 0);
if (send_ret < 0) {
ERR("Relay sending stream id");
+ ret = send_ret;
}
rcu_read_unlock();
sizeof(struct lttcomm_relayd_generic_reply), 0);
if (send_ret < 0) {
ERR("Relay sending stream id");
+ ret = send_ret;
}
end_no_session:
do {
ret = write(fd, zeros, size);
} while (ret < 0 && errno == EINTR);
- if (ret < 0) {
+ if (ret < 0 || ret != size) {
PERROR("write padding to file");
}
ret = write(metadata_stream->fd, metadata_struct->payload,
payload_size);
} while (ret < 0 && errno == EINTR);
- if (ret < payload_size) {
+ if (ret < 0 || ret != payload_size) {
ERR("Relay error writing metadata on file");
ret = -1;
goto end_unlock;
do {
ret = write(stream->fd, data_buffer, data_size);
} while (ret < 0 && errno == EINTR);
- if (ret < data_size) {
+ if (ret < 0 || ret != data_size) {
ERR("Relay error writing data to file");
ret = -1;
goto end_unlock;