diff options
author | Lasse Collin <lasse.collin@tukaani.org> | 2013-07-01 14:34:11 +0300 |
---|---|---|
committer | Lasse Collin <lasse.collin@tukaani.org> | 2013-07-01 14:34:11 +0300 |
commit | c0627b3fceacfa1ed162f5f55235360ea26f569a (patch) | |
tree | a04578ee762561827e2fc6e0524013efa5ffd547 /src | |
parent | Update NEWS for 5.0.5. (diff) | |
download | xz-c0627b3fceacfa1ed162f5f55235360ea26f569a.tar.xz |
xz: Silence a warning seen with _FORTIFY_SOURCE=2.
Thanks to Christian Hesse.
Diffstat (limited to 'src')
-rw-r--r-- | src/xz/file_io.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/xz/file_io.c b/src/xz/file_io.c index 9b0942c2..9db7dc58 100644 --- a/src/xz/file_io.c +++ b/src/xz/file_io.c @@ -98,8 +98,14 @@ io_init(void) extern void io_write_to_user_abort_pipe(void) { + // If the write() fails, it's probably due to the pipe being full. + // Failing in that case is fine. If the reason is something else, + // there's not much we can do since this is called in a signal + // handler. So ignore the errors and try to avoid warnings with + // GCC and glibc when _FORTIFY_SOURCE=2 is used. uint8_t b = '\0'; - (void)write(user_abort_pipe[1], &b, 1); + const int ret = write(user_abort_pipe[1], &b, 1); + (void)ret; return; } #endif |