summaryrefslogtreecommitdiff
path: root/sideband.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2013-02-20 20:01:56 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-02-20 21:42:21 (GMT)
commitcdf4fb8e332f9641ac1ca95e999fe98251d31392 (patch)
tree0c65db4797e4060603ef32092fa250ecfa4f3815 /sideband.c
parente148542870013e40d02490e692818a62691c1a10 (diff)
downloadgit-cdf4fb8e332f9641ac1ca95e999fe98251d31392.zip
git-cdf4fb8e332f9641ac1ca95e999fe98251d31392.tar.gz
git-cdf4fb8e332f9641ac1ca95e999fe98251d31392.tar.bz2
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 'sideband.c')
-rw-r--r--sideband.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sideband.c b/sideband.c
index d5ffa1c..8f7b25b 100644
--- a/sideband.c
+++ b/sideband.c
@@ -1,3 +1,4 @@
+#include "cache.h"
#include "pkt-line.h"
#include "sideband.h"
@@ -108,7 +109,7 @@ int recv_sideband(const char *me, int in_stream, int out)
} while (len);
continue;
case 1:
- safe_write(out, buf + pf+1, len);
+ write_or_die(out, buf + pf+1, len);
continue;
default:
fprintf(stderr, "%s: protocol error: bad band #%d\n",
@@ -138,12 +139,12 @@ ssize_t send_sideband(int fd, int band, const char *data, ssize_t sz, int packet
if (0 <= band) {
sprintf(hdr, "%04x", n + 5);
hdr[4] = band;
- safe_write(fd, hdr, 5);
+ write_or_die(fd, hdr, 5);
} else {
sprintf(hdr, "%04x", n + 4);
- safe_write(fd, hdr, 4);
+ write_or_die(fd, hdr, 4);
}
- safe_write(fd, p, n);
+ write_or_die(fd, p, n);
p += n;
sz -= n;
}