Commits

Junio C Hamano  committed 3f83594 Merge

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()

  • Participants
  • Parent commits d8ce800, f633ea2

Comments (0)

Files changed (1)

File merge-recursive.c

 	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);
 			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);