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;
}
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;
ret = write(apps_cmd_pipe[1], ust_cmd,
sizeof(struct ust_command));
} while (ret < 0 && errno == EINTR);
- if (ret < 0) {
+ if (ret < 0 || ret != sizeof(struct ust_command)) {
PERROR("write apps cmd pipe");
if (errno == EBADF) {
/*
do {
ret = write(ctx->consumer_should_quit[1], "4", 1);
} while (ret < 0 && errno == EINTR);
- if (ret < 0) {
+ if (ret < 0 || ret != 1) {
PERROR("write consumer quit");
}
do {
ret = write(fd, (void *) &hdr, sizeof(hdr));
} while (ret < 0 && errno == EINTR);
- if (ret < 0) {
+ if (ret < 0 || ret != sizeof(hdr)) {
/*
* This error means that the fd's end is closed so ignore the perror
* not to clubber the error output since this can happen in a normal