commit 68bda3b1b9c8bd7159479cf0c194d755b7d2a7cd from: Stefan Sperling date: Wed Oct 09 08:20:05 2019 UTC diff3.c: check for unlink errors and unlink dp13 and dp23 again commit - 9688d20ad63057dfb1047a7c31d629b07d92618b commit + 68bda3b1b9c8bd7159479cf0c194d755b7d2a7cd blob - c22d2b2d0f7b76684ab000e8bb2dd476e725bc08 blob + c088b41993852ef4dc4a9cafcb41d7d1a971edb5 --- lib/diff3.c +++ lib/diff3.c @@ -245,7 +245,8 @@ diffreg(BUF **d, const char *path1, const char *path2) err = buf_load(d, outpath); done: if (outpath) { - unlink(outpath); + if (unlink(outpath) == -1 && err == NULL) + err = got_error_from_errno2("unlink", outpath); free(outpath); } if (outfile && fclose(outfile) != 0 && err == NULL) @@ -382,9 +383,16 @@ out: buf_free(d1); buf_free(d2); - (void)unlink(path1); - (void)unlink(path2); - (void)unlink(path3); + if (unlink(path1) == -1 && err == NULL) + err = got_error_from_errno2("unlink", path1); + if (unlink(path2) == -1 && err == NULL) + err = got_error_from_errno2("unlink", path2); + if (unlink(path3) == -1 && err == NULL) + err = got_error_from_errno2("unlink", path3); + if (unlink(dp13) == -1 && err == NULL) + err = got_error_from_errno2("unlink", dp13); + if (unlink(dp23) == -1 && err == NULL) + err = got_error_from_errno2("unlink", dp23); free(path1); free(path2);