mirror of
https://github.com/NLnetLabs/unbound.git
synced 2026-09-22 09:44:56 +02:00
Merge pull request #1510 from aww-aww/patch-1
Move unlink of temp file to before fatal exit
This commit is contained in:
@@ -1275,9 +1275,9 @@ void autr_write_file(struct module_env* env, struct trust_anchor* tp)
|
||||
FlushFileBuffers((HANDLE)_get_osfhandle(_fileno(out)));
|
||||
#endif
|
||||
if(fclose(out) != 0) {
|
||||
unlink(tempf);
|
||||
fatal_exit("could not complete write: %s: %s",
|
||||
fname, strerror(errno));
|
||||
unlink(tempf);
|
||||
return;
|
||||
}
|
||||
/* success; overwrite actual file */
|
||||
|
||||
Reference in New Issue
Block a user