X-Git-Url: https://wimlib.net/git/?p=wimlib;a=blobdiff_plain;f=src%2Fwrite.c;h=7c4d985c7885903faaca9c0d0b9c73707ae5f4b4;hp=fd61ae1d747da0e427b8c45e8ebd869db5841385;hb=79b64b516e5bdb486832f88788362dbe9deb1b61;hpb=16e3b6e5615abcefc9e5bb9607e2804b64d19cc2 diff --git a/src/write.c b/src/write.c index fd61ae1d..7c4d985c 100644 --- a/src/write.c +++ b/src/write.c @@ -85,6 +85,8 @@ WIMLIBAPI int wimlib_overwrite(WIMStruct *w, int write_flags) ret = wimlib_write(w, tmpfile, WIM_ALL_IMAGES, write_flags); if (ret != 0) { ERROR("Failed to write the WIM file `%s'", tmpfile); + if (unlink(tmpfile) != 0) + WARNING("Failed to remove `%s'", tmpfile); return ret; } @@ -485,10 +487,11 @@ WIMLIBAPI int wimlib_write(WIMStruct *w, const char *path, ret = for_image(w, image, write_metadata_resource); if (ret != 0) { - ERROR("Failed to write WIM image metadata to `%s'", path); + /*ERROR("Failed to write WIM image metadata to `%s'", path);*/ goto out; } + ret = finish_write(w, image, write_flags); out: