diff options
| author | Igor Sysoev <igor@sysoev.ru> | 2008-11-20 17:23:08 +0000 |
|---|---|---|
| committer | Igor Sysoev <igor@sysoev.ru> | 2008-11-20 17:23:08 +0000 |
| commit | d0d575bcd5201eab1aacdf682f6fc11d1f46c682 (patch) | |
| tree | 46a8602d403f496399972b2958990e041b4a4972 /src/os/unix/ngx_files.h | |
| parent | 3d87cb964c1388b41552c08358987df320943386 (diff) | |
| download | nginx-d0d575bcd5201eab1aacdf682f6fc11d1f46c682.tar.gz nginx-d0d575bcd5201eab1aacdf682f6fc11d1f46c682.tar.bz2 | |
r2303 merge:
compatibility with glibc 2.3, warn_unused_result attribute for write()
Diffstat (limited to 'src/os/unix/ngx_files.h')
| -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 a223b34e8..419f2fba0 100644 --- a/src/os/unix/ngx_files.h +++ b/src/os/unix/ngx_files.h @@ -68,7 +68,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; |
