sigwait: Do not fail with EINTR and return error code [BZ #22478]
commitcccb6d4e87053ed63c74aee063fa84eb63ebf7b8
authorFlorian Weimer <fweimer@redhat.com>
Thu, 23 Nov 2017 10:20:53 +0000 (23 11:20 +0100)
committerFlorian Weimer <fweimer@redhat.com>
Thu, 23 Nov 2017 10:20:53 +0000 (23 11:20 +0100)
treef1098c8ca0e6fa500e1e75f6b1c76650afe507ec
parent59d2cbb1fe4b8601d5cbd359c3806973eab6c62d
sigwait: Do not fail with EINTR and return error code [BZ #22478]

Since

commit 8b0e795aaa445e9167aa07b282c5720b35342c07
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Wed Nov 1 11:49:05 2017 -0200

    Simplify Linux sig{timed}wait{info} implementations

sigwait can fail with EINTR.  Applications do not expect that, and the
error code is not documented in POSIX or the manual pages.

This commit restores the previous behavior by retrying the system call
on EINTR.  It also returns the error code, not -1, on the remaing
errors.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
ChangeLog
signal/Makefile
signal/tst-sigwait-eintr.c [new file with mode: 0644]
sysdeps/unix/sysv/linux/sigwait.c