ngx_ext_rename_file: remove the target file if ngx_copy_file() fails

Mindaugas Rasiukevicius rmind at
Tue Nov 17 17:26:52 UTC 2015


Sorry for late response.

Maxim Dounin <mdounin at> wrote:
> ...
> By calling ngx_delete_file() at this point, you do this for all 
> errors returned by ngx_copy_file(), including cases when it wasn't 
> able to open a destination file for some reason.  This will result 
> in additional confusing errors, and looks like a wrong approach.
> If you want nginx to remove a destination file, this should be 
> done in ngx_copy_file().

Good point.  Please find the new patch attached.

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ngx_copy_file.patch
URL: <>

More information about the nginx-devel mailing list