Thread (45 messages) flat view 45 messages, 4 authors, 2017-09-15

Re: [PATCH 6/7] notes-merge: use ssize_t for write_in_full() return value

From: Jeff King <hidden>
Date: 2017-09-15 00:43:48

On Wed, Sep 13, 2017 at 02:20:35PM -0700, Jonathan Nieder wrote:
quoted
--- a/notes-merge.c
+++ b/notes-merge.c
@@ -302,7 +302,7 @@ static void write_buf_to_worktree(const struct object_id *obj,
 	fd = xopen(path, O_WRONLY | O_EXCL | O_CREAT, 0666);
 
 	while (size > 0) {
-		long ret = write_in_full(fd, buf, size);
+		ssize_t ret = write_in_full(fd, buf, size);
 		if (ret < 0) {
 			/* Ignore epipe */
 			if (errno == EPIPE)
				break;
			die_errno("notes-merge");
		} else if (!ret) {
			die("notes-merge: disk full?");
		}
These three lines are dead code.  How about the following, e.g. for
squashing in?
Thanks, I didn't notice that.

I'd actually prefer it as a separate patch, since it needs explained
separately.

-Peff
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help