Mercurial > hg > nginx-quic
comparison src/core/ngx_connection.c @ 5163:c0497468f521 stable-1.2
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.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Fri, 29 Mar 2013 18:18:42 +0000 |
parents | 5e9d5786ec06 |
children |
comparison
equal
deleted
inserted
replaced
5162:ee9a043765ea | 5163:c0497468f521 |
---|---|
410 ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_errno, | 410 ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_errno, |
411 "chmod() \"%s\" failed", name); | 411 "chmod() \"%s\" failed", name); |
412 } | 412 } |
413 | 413 |
414 if (ngx_test_config) { | 414 if (ngx_test_config) { |
415 if (ngx_delete_file(name) == -1) { | 415 if (ngx_delete_file(name) == NGX_FILE_ERROR) { |
416 ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_errno, | 416 ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_errno, |
417 ngx_delete_file_n " %s failed", name); | 417 ngx_delete_file_n " %s failed", name); |
418 } | 418 } |
419 } | 419 } |
420 } | 420 } |
737 && ngx_process <= NGX_PROCESS_MASTER | 737 && ngx_process <= NGX_PROCESS_MASTER |
738 && ngx_new_binary == 0) | 738 && ngx_new_binary == 0) |
739 { | 739 { |
740 u_char *name = ls[i].addr_text.data + sizeof("unix:") - 1; | 740 u_char *name = ls[i].addr_text.data + sizeof("unix:") - 1; |
741 | 741 |
742 if (ngx_delete_file(name) == -1) { | 742 if (ngx_delete_file(name) == NGX_FILE_ERROR) { |
743 ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_socket_errno, | 743 ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_socket_errno, |
744 ngx_delete_file_n " %s failed", name); | 744 ngx_delete_file_n " %s failed", name); |
745 } | 745 } |
746 } | 746 } |
747 | 747 |