xz: Silence a warning seen with _FORTIFY_SOURCE=2.

Thanks to Christian Hesse.
This commit is contained in:
Lasse Collin 2013-07-01 14:34:11 +03:00
parent 1936718bb3
commit c0627b3fce
1 changed files with 7 additions and 1 deletions

View File

@ -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