diff src/os/unix/ngx_files.h @ 418:ff86d646f9df NGINX_0_7_21

nginx 0.7.21 *) Changes in the ngx_http_limit_req_module. *) Feature: the EXSLT support in the ngx_http_xslt_module. Thanks to Denis F. Latypoff. *) Workaround: compatibility with glibc 2.3. Thanks to Eric Benson and Maxim Dounin. *) Bugfix: nginx could not run on MacOSX 10.4 and earlier; the bug had appeared in 0.7.6.
author Igor Sysoev <http://sysoev.ru>
date Tue, 11 Nov 2008 00:00:00 +0300
parents b246022ef454
children ca8f7f6cab16
line wrap: on
line diff
--- a/src/os/unix/ngx_files.h
+++ b/src/os/unix/ngx_files.h
@@ -99,7 +99,17 @@ ssize_t ngx_write_chain_to_file(ngx_file
 #define ngx_read_fd              read
 #define ngx_read_fd_n            "read()"
 
-#define ngx_write_fd             write
+/*
+ * we use inlined function instead of simple #define
+ * because glibc 2.3 sets warn_unused_result attribute for write()
+ * and in this case gcc 4.3 ignores (void) cast
+ */
+static ngx_inline ssize_t
+ngx_write_fd(ngx_fd_t fd, void *buf, size_t n)
+{
+    return write(fd, buf, n);
+}
+
 #define ngx_write_fd_n           "write()"
 
 #define ngx_linefeed(p)          *p++ = LF;