Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nginx/nginx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValentin Bartenev <vbart@nginx.com>2013-03-25 19:49:11 +0400
committerValentin Bartenev <vbart@nginx.com>2013-03-25 19:49:11 +0400
commit604e18fb2c97b86b49b93b969d55003c9656f143 (patch)
treea93a3ba36cf535d7aed22f8d647e1a2e79a7fde5 /src/core/ngx_connection.c
parentea327f13f130be87cf3023e215d1c97b5465343f (diff)
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.
Diffstat (limited to 'src/core/ngx_connection.c')
-rw-r--r--src/core/ngx_connection.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/ngx_connection.c b/src/core/ngx_connection.c
index 60f4d5145..7ed781e0a 100644
--- a/src/core/ngx_connection.c
+++ b/src/core/ngx_connection.c
@@ -412,7 +412,7 @@ ngx_open_listening_sockets(ngx_cycle_t *cycle)
}
if (ngx_test_config) {
- if (ngx_delete_file(name) == -1) {
+ if (ngx_delete_file(name) == NGX_FILE_ERROR) {
ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_errno,
ngx_delete_file_n " %s failed", name);
}
@@ -739,7 +739,7 @@ ngx_close_listening_sockets(ngx_cycle_t *cycle)
{
u_char *name = ls[i].addr_text.data + sizeof("unix:") - 1;
- if (ngx_delete_file(name) == -1) {
+ if (ngx_delete_file(name) == NGX_FILE_ERROR) {
ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_socket_errno,
ngx_delete_file_n " %s failed", name);
}