summaryrefslogtreecommitdiff
path: root/builtin/upload-archive.c
diff options
context:
space:
mode:
Diffstat (limited to 'builtin/upload-archive.c')
-rw-r--r--builtin/upload-archive.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/builtin/upload-archive.c b/builtin/upload-archive.c
index 32ab94c..2caedf1 100644
--- a/builtin/upload-archive.c
+++ b/builtin/upload-archive.c
@@ -49,15 +49,14 @@ int cmd_upload_archive_writer(int argc, const char **argv, const char *prefix)
__attribute__((format (printf, 1, 2)))
static void error_clnt(const char *fmt, ...)
{
- char buf[1024];
+ struct strbuf buf = STRBUF_INIT;
va_list params;
- int len;
va_start(params, fmt);
- len = vsprintf(buf, fmt, params);
+ strbuf_vaddf(&buf, fmt, params);
va_end(params);
- send_sideband(1, 3, buf, len, LARGE_PACKET_MAX);
- die("sent error to the client: %s", buf);
+ send_sideband(1, 3, buf.buf, buf.len, LARGE_PACKET_MAX);
+ die("sent error to the client: %s", buf.buf);
}
static ssize_t process_input(int child_fd, int band)
@@ -105,8 +104,7 @@ int cmd_upload_archive(int argc, const char **argv, const char *prefix)
pfd[1].events = POLLIN;
if (poll(pfd, 2, -1) < 0) {
if (errno != EINTR) {
- error("poll failed resuming: %s",
- strerror(errno));
+ error_errno("poll failed resuming");
sleep(1);
}
continue;