Commit b87c6f836d2cb7d597e245c70ea4540cf6a36af4

Stefan Sperling 2018-12-24T17:09:24

catch fatal i/o errors in add_file_on_disk()

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
diff --git a/lib/worktree.c b/lib/worktree.c
index e296ce1..e9cc817 100644
--- a/lib/worktree.c
+++ b/lib/worktree.c
@@ -408,10 +408,10 @@ add_file_on_disk(struct got_worktree *worktree, struct got_fileindex *fileindex,
 			hdrlen = 0;
 			if (outlen == -1) {
 				err = got_error_from_errno();
-				break;
+				goto done;
 			} else if (outlen != len) {
 				err = got_error(GOT_ERR_IO);
-				break;
+				goto done;
 			}
 		}
 	} while (len != 0);