X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=ustd%2Flowlevel.c;h=a10f9317c056abd0fb639728ad2addad7e0b5129;hb=a09dac63957396890b1085cac0fee92ecc5db87a;hp=5c145fa3f9e9ffae7cb947ef9ab76643eada4290;hpb=909bc43f70be2b1d3efcefe33121ee1e99d9895b;p=ust.git diff --git a/ustd/lowlevel.c b/ustd/lowlevel.c index 5c145fa..a10f931 100644 --- a/ustd/lowlevel.c +++ b/ustd/lowlevel.c @@ -64,6 +64,8 @@ size_t subbuffer_data_size(void *subbuf) void finish_consuming_dead_subbuffer(struct buffer_info *buf) { + int result; + struct ust_buffer *ustbuf = buf->bufstruct_mem; long write_offset = uatomic_read(&ustbuf->offset); @@ -137,14 +139,22 @@ void finish_consuming_dead_subbuffer(struct buffer_info *buf) } - patient_write(buf->file_fd, buf->mem + i_subbuf * buf->subbuf_size, valid_length); + result = patient_write(buf->file_fd, buf->mem + i_subbuf * buf->subbuf_size, valid_length); + if(result == -1) { + ERR("Error writing to buffer file"); + return; + } /* pad with empty bytes */ pad_size = PAGE_ALIGN(valid_length)-valid_length; if(pad_size) { tmp = malloc(pad_size); memset(tmp, 0, pad_size); - patient_write(buf->file_fd, tmp, pad_size); + result = patient_write(buf->file_fd, tmp, pad_size); + if(result == -1) { + ERR("Error writing to buffer file"); + return; + } free(tmp); }