The clear is superfluous. Kill the caller and the function.
Ensure that we leave the output buffer in a sane state, once
buf_output_free() has been called on it.
Signed-off-by: Jens Axboe <axboe@fb.com>
void buf_output_free(struct buf_output *out)
{
free(out->buf);
+ buf_output_init(out);
}
size_t buf_output_add(struct buf_output *out, const char *buf, size_t len)
out->buflen += len;
return len;
}
-
-void buf_output_clear(struct buf_output *out)
-{
- if (out->buflen) {
- memset(out->buf, 0, out->max_buflen);
- out->buflen = 0;
- }
-}
void buf_output_init(struct buf_output *out);
void buf_output_free(struct buf_output *out);
size_t buf_output_add(struct buf_output *out, const char *buf, size_t len);
-void buf_output_clear(struct buf_output *out);
#endif
for (i = 0; i < FIO_OUTPUT_NR; i++) {
struct buf_output *out = &output[i];
+
log_info_buf(out->buf, out->buflen);
- buf_output_clear(out);
buf_output_free(out);
}