| 162 | } |
| 163 | |
| 164 | static int packet_write_fmt_1(int fd, int gently, const char *prefix, |
| 165 | const char *fmt, va_list args) |
| 166 | { |
| 167 | static struct strbuf buf = STRBUF_INIT; |
| 168 | |
| 169 | strbuf_reset(&buf); |
| 170 | format_packet(&buf, prefix, fmt, args); |
| 171 | if (write_in_full(fd, buf.buf, buf.len) < 0) { |
| 172 | if (!gently) { |
| 173 | check_pipe(errno); |
| 174 | die_errno(_("packet write with format failed")); |
| 175 | } |
| 176 | return error(_("packet write with format failed")); |
| 177 | } |
| 178 | |
| 179 | return 0; |
| 180 | } |
| 181 | |
| 182 | void packet_write_fmt(int fd, const char *fmt, ...) |
| 183 | { |
no test coverage detected