Welcome! Log In Create A New Profile

Advanced

[nginx] svn commit: r4486 - in trunk/src: core os/unix

Anonymous User
February 20, 2012 02:16PM
Author: mdounin
Date: 2012-02-20 19:14:35 +0000 (Mon, 20 Feb 2012)
New Revision: 4486

Log:
Disable symlinks: added explicit cast of AT_FDCWD (ticket #111).

Solaris has AT_FDCWD defined to unsigned value, and comparison of a file
descriptor with it causes warnings in modern versions of gcc. Explicitly
cast AT_FDCWD to ngx_fd_t to resolve these warnings.


Modified:
trunk/src/core/ngx_open_file_cache.c
trunk/src/os/unix/ngx_files.h

Modified: trunk/src/core/ngx_open_file_cache.c
===================================================================
--- trunk/src/core/ngx_open_file_cache.c 2012-02-20 19:14:07 UTC (rev 4485)
+++ trunk/src/core/ngx_open_file_cache.c 2012-02-20 19:14:35 UTC (rev 4486)
@@ -582,7 +582,7 @@
p = name->data;
end = p + name->len;

- at_fd = AT_FDCWD;
+ at_fd = NGX_AT_FDCWD;
at_name = *name;

if (p[0] == '/') {
@@ -632,7 +632,7 @@
goto failed;
}

- if (at_fd != AT_FDCWD && ngx_close_file(at_fd) == NGX_FILE_ERROR) {
+ if (at_fd != NGX_AT_FDCWD && ngx_close_file(at_fd) == NGX_FILE_ERROR) {
ngx_log_error(NGX_LOG_ALERT, log, ngx_errno,
ngx_close_file_n " \"%V\" failed", &at_name);
}
@@ -642,7 +642,7 @@
at_name.len = cp - at_name.data;
}

- if (p == end && at_fd != AT_FDCWD) {
+ if (p == end && at_fd != NGX_AT_FDCWD) {

/*
* If pathname ends with a trailing slash, check if last path
@@ -690,7 +690,7 @@

failed:

- if (at_fd != AT_FDCWD && ngx_close_file(at_fd) == NGX_FILE_ERROR) {
+ if (at_fd != NGX_AT_FDCWD && ngx_close_file(at_fd) == NGX_FILE_ERROR) {
ngx_log_error(NGX_LOG_ALERT, log, ngx_errno,
ngx_close_file_n " \"%V\" failed", &at_name);
}

Modified: trunk/src/os/unix/ngx_files.h
===================================================================
--- trunk/src/os/unix/ngx_files.h 2012-02-20 19:14:07 UTC (rev 4485)
+++ trunk/src/os/unix/ngx_files.h 2012-02-20 19:14:35 UTC (rev 4486)
@@ -340,6 +340,8 @@

#define ngx_file_at_info_n "fstatat()"

+#define NGX_AT_FDCWD (ngx_fd_t) AT_FDCWD
+
#endif



_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] svn commit: r4486 - in trunk/src: core os/unix

Anonymous User 1176 February 20, 2012 02:16PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 117
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready