From e693243a9f0382486b74fe9ca4248f9e4eca507e Mon Sep 17 00:00:00 2001 From: Maxim Dounin Date: Fri, 29 Mar 2013 18:18:42 +0000 Subject: Merge of r5138: use of NGX_FILE_ERROR. Use NGX_FILE_ERROR for handling file operations errors. On Win32 platforms 0 is used to indicate errors in file operations, so comparing against either -1 or NGX_OK is not portable. This was not much of an issue in patched code, since only ngx_fd_info() test is actually reachable on Win32 and in worst case it might result in bogus error log entry. Patch by Piotr Sikora. --- src/os/unix/ngx_process_cycle.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/os/unix/ngx_process_cycle.c') diff --git a/src/os/unix/ngx_process_cycle.c b/src/os/unix/ngx_process_cycle.c index c9b0266ed..dfdfae081 100644 --- a/src/os/unix/ngx_process_cycle.c +++ b/src/os/unix/ngx_process_cycle.c @@ -647,7 +647,7 @@ ngx_reap_children(ngx_cycle_t *cycle) if (ngx_rename_file((char *) ccf->oldpid.data, (char *) ccf->pid.data) - != NGX_OK) + == NGX_FILE_ERROR) { ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno, ngx_rename_file_n " %s back to %s failed " -- cgit