diff options
author | Igor Sysoev <igor@sysoev.ru> | 2008-11-11 19:17:45 +0300 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2008-11-11 19:17:45 +0300 |
commit | f2884e194ab1bfe7bec979d04b21dc5f5e4a3628 (patch) | |
tree | 8f3b8c6e72e2a63ebfa6c49fec1b3d39580995f2 /src/os | |
parent | ead8091746f136d7563824c7468d570481fb4e3c (diff) |
compatibility with glibc 2.3, warn_unused_result attribute for write()
Diffstat (limited to 'src/os')
-rw-r--r-- | src/os/unix/ngx_files.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/os/unix/ngx_files.h b/src/os/unix/ngx_files.h index d8182b4b6..fe14887f1 100644 --- 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_t *file, ngx_chain_t *ce, #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; |