comparison src/core/ngx_cycle.c @ 5137:f941cf265cc5

Use NGX_FILE_ERROR for handling file operations errors. On Win32 platforms 0 is used to indicate errors in file operations, so comparing against -1 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.
author Valentin Bartenev <vbart@nginx.com>
date Mon, 25 Mar 2013 15:49:11 +0000
parents a0599b56e748
children 85e72ea8fbfd
comparison
equal deleted inserted replaced
5136:88a302caca75 5137:f941cf265cc5
677 name = ls[i].addr_text.data + sizeof("unix:") - 1; 677 name = ls[i].addr_text.data + sizeof("unix:") - 1;
678 678
679 ngx_log_error(NGX_LOG_WARN, cycle->log, 0, 679 ngx_log_error(NGX_LOG_WARN, cycle->log, 0,
680 "deleting socket %s", name); 680 "deleting socket %s", name);
681 681
682 if (ngx_delete_file(name) == -1) { 682 if (ngx_delete_file(name) == NGX_FILE_ERROR) {
683 ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_socket_errno, 683 ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_socket_errno,
684 ngx_delete_file_n " %s failed", name); 684 ngx_delete_file_n " %s failed", name);
685 } 685 }
686 } 686 }
687 687