| 478 | } |
| 479 | |
| 480 | void reduce_iobuf_size(xbuf *out, size_t new_size) |
| 481 | { |
| 482 | if (new_size < out->size) { |
| 483 | /* Avoid weird buffer interactions by only outputting this to stderr. */ |
| 484 | if (msgs2stderr == 1 && DEBUG_GTE(IO, 4)) { |
| 485 | const char *name = out == &iobuf.out ? "iobuf.out" |
| 486 | : out == &iobuf.msg ? "iobuf.msg" |
| 487 | : NULL; |
| 488 | if (name) { |
| 489 | rprintf(FINFO, "[%s] reduced size of %s (-%d)\n", |
| 490 | who_am_i(), name, (int)(out->size - new_size)); |
| 491 | } |
| 492 | } |
| 493 | out->size = new_size; |
| 494 | } |
| 495 | } |
| 496 | |
| 497 | void restore_iobuf_size(xbuf *out) |
| 498 | { |
no test coverage detected