summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2012-09-11 10:53:31 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2012-09-11 10:53:31 -0700
commit3f835949e9b800619136f2511e84000c95916d6e (patch)
treead9e0ab3ac73e205037d274afff6b2c8e1acb46c
parentMerge branch 'nd/index-errno' into maint-1.7.11 (diff)
parentmerge-recursive: eliminate flush_buffer() in favor of write_in_full() (diff)
downloadtgif-3f835949e9b800619136f2511e84000c95916d6e.tar.xz
Merge branch 'tr/merge-recursive-flush' into maint-1.7.11
* tr/merge-recursive-flush: merge-recursive: eliminate flush_buffer() in favor of write_in_full()
-rw-r--r--merge-recursive.c19
1 files changed, 1 insertions, 18 deletions
diff --git a/merge-recursive.c b/merge-recursive.c
index 680937c39e..8801b9d2f1 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@@ -614,23 +614,6 @@ static char *unique_path(struct merge_options *o, const char *path, const char *
return newpath;
}
-static void flush_buffer(int fd, const char *buf, unsigned long size)
-{
- while (size > 0) {
- long ret = write_in_full(fd, buf, size);
- if (ret < 0) {
- /* Ignore epipe */
- if (errno == EPIPE)
- break;
- die_errno("merge-recursive");
- } else if (!ret) {
- die("merge-recursive: disk full?");
- }
- size -= ret;
- buf += ret;
- }
-}
-
static int dir_in_way(const char *path, int check_working_copy)
{
int pos, pathlen = strlen(path);
@@ -789,7 +772,7 @@ static void update_file_flags(struct merge_options *o,
fd = open(path, O_WRONLY | O_TRUNC | O_CREAT, mode);
if (fd < 0)
die_errno("failed to open '%s'", path);
- flush_buffer(fd, buf, size);
+ write_in_full(fd, buf, size);
close(fd);
} else if (S_ISLNK(mode)) {
char *lnk = xmemdupz(buf, size);