commit - 5ea74b5a394cdadfb08905818a3bd053c5e06dfb
commit + 816dc65482b52c96c56a51b75215584b84eda1ee
blob - 37c8744b87c5306d5226f968dcaefb4cc5bdd970
blob + 28e60df1feddc66aaa4be09871a80d53f3834ae8
--- lib/worktree.c
+++ lib/worktree.c
overlapcnt > 0 ? GOT_STATUS_CONFLICT : GOT_STATUS_MERGE, path);
- fsync(merged_fd);
+ if (fsync(merged_fd) != 0) {
+ err = got_error_from_errno();
+ goto done;
+ }
if (rename(merged_path, ondisk_path) != 0) {
err = got_error_from_errno();
}
} while (len != 0);
- fsync(fd);
+ if (fsync(fd) != 0) {
+ err = got_error_from_errno();
+ goto done;
+ }
if (update) {
if (rename(tmppath, ondisk_path) != 0) {