summaryrefslogtreecommitdiff
path: root/strbuf.c
diff options
context:
space:
mode:
authorLibravatar Randall S. Becker <randall.becker@nexbridge.ca>2020-06-19 16:23:20 -0400
committerLibravatar Junio C Hamano <gitster@pobox.com>2020-06-19 13:50:27 -0700
commit5f2b643e76d9a1330c1a02489c0787ca7d818633 (patch)
treef5171bf1069efa7c0b0c6b7ae0416bf0999e9cab /strbuf.c
parentbugreport.c: replace strbuf_write_fd with write_in_full (diff)
downloadtgif-5f2b643e76d9a1330c1a02489c0787ca7d818633.tar.xz
strbuf: remove unreferenced strbuf_write_fd method.
strbuf_write_fd was only used in bugreport.c. Since that file now uses write_in_full, this method is no longer needed. In addition, strbuf_write_fd did not guard against exceeding MAX_IO_SIZE for the platform, nor provided error handling in the event of a failure if only partial data was written to the file descriptor. Since already write_in_full has this capability and is in general use, it should be used instead. The change impacts strbuf.c and strbuf.h. Signed-off-by: Randall S. Becker <rsbecker@nexbridge.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'strbuf.c')
-rw-r--r--strbuf.c5
1 files changed, 0 insertions, 5 deletions
diff --git a/strbuf.c b/strbuf.c
index f1d66c7848..4bbaff2bda 100644
--- a/strbuf.c
+++ b/strbuf.c
@@ -539,11 +539,6 @@ ssize_t strbuf_write(struct strbuf *sb, FILE *f)
return sb->len ? fwrite(sb->buf, 1, sb->len, f) : 0;
}
-ssize_t strbuf_write_fd(struct strbuf *sb, int fd)
-{
- return sb->len ? write(fd, sb->buf, sb->len) : 0;
-}
-
#define STRBUF_MAXLINK (2*PATH_MAX)
int strbuf_readlink(struct strbuf *sb, const char *path, size_t hint)