summaryrefslogtreecommitdiff
path: root/http-backend.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2013-02-20 15:01:56 -0500
committerJunio C Hamano <gitster@pobox.com>2013-02-20 13:42:21 -0800
commitcdf4fb8e332f9641ac1ca95e999fe98251d31392 (patch)
tree0c65db4797e4060603ef32092fa250ecfa4f3815 /http-backend.c
parente148542870013e40d02490e692818a62691c1a10 (diff)
downloadgit-cdf4fb8e332f9641ac1ca95e999fe98251d31392.tar.gz
pkt-line: drop safe_write function
This is just write_or_die by another name. The one distinction is that write_or_die will treat EPIPE specially by suppressing error messages. That's fine, as we die by SIGPIPE anyway (and in the off chance that it is disabled, write_or_die will simulate it). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'http-backend.c')
-rw-r--r--http-backend.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/http-backend.c b/http-backend.c
index f50e77fb28..8144f3ad5e 100644
--- a/http-backend.c
+++ b/http-backend.c
@@ -70,7 +70,7 @@ static void format_write(int fd, const char *fmt, ...)
if (n >= sizeof(buffer))
die("protocol error: impossibly long line");
- safe_write(fd, buffer, n);
+ write_or_die(fd, buffer, n);
}
static void http_status(unsigned code, const char *msg)
@@ -111,7 +111,7 @@ static void hdr_cache_forever(void)
static void end_headers(void)
{
- safe_write(1, "\r\n", 2);
+ write_or_die(1, "\r\n", 2);
}
__attribute__((format (printf, 1, 2)))
@@ -157,7 +157,7 @@ static void send_strbuf(const char *type, struct strbuf *buf)
hdr_int(content_length, buf->len);
hdr_str(content_type, type);
end_headers();
- safe_write(1, buf->buf, buf->len);
+ write_or_die(1, buf->buf, buf->len);
}
static void send_local_file(const char *the_type, const char *name)
@@ -185,7 +185,7 @@ static void send_local_file(const char *the_type, const char *name)
die_errno("Cannot read '%s'", p);
if (!n)
break;
- safe_write(1, buf, n);
+ write_or_die(1, buf, n);
}
close(fd);
free(buf);