X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=merge-recursive.c;h=eed936ebec2a83fa87d67e9c25093546fe77bb57;hb=f633ea2c736a2a38e92fcf61e90c8adadc5c504d;hp=d83cd6c662847fb51641d7b8bf16739e588f67a2;hpb=3fc242f5ab8222745892047d4e481e71540425cd;p=thirdparty%2Fgit.git diff --git a/merge-recursive.c b/merge-recursive.c index d83cd6c662..eed936ebec 100644 --- a/merge-recursive.c +++ b/merge-recursive.c @@ -613,23 +613,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); @@ -788,7 +771,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);