ngx_ext_rename_file: remove the target file if ngx_copy_file() fails

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


Hi,

Sorry for late response.

Maxim Dounin <mdounin at mdounin.ru> 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.

-- 
Mindaugas
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ngx_copy_file.patch
URL: <http://mailman.nginx.org/pipermail/nginx-devel/attachments/20151117/1bee3dbd/attachment.ksh>


More information about the nginx-devel mailing list