[PATCH 2/3] xfsqa: Fix signal usage in aio-dio test code
Christoph Hellwig
hch at infradead.org
Tue Jan 19 03:18:06 CST 2010
On Tue, Jan 19, 2010 at 08:03:11PM +1100, Dave Chinner wrote:
> Using signal() to set up signal handlers doesn't always do what you
> want. A recent upgrade made test 208 fail because wait() was not
> getting interrupted by a SIGALRM. Tracing showed that signal() was
> being converted to a sigaction(SA_RESTART) handler, which allows
> syscalls that return ERESTARTSYS to immediately restart without
> returning EINTR to the calling process. The kernel code returns
> ERESTARTSYS to signal interruptions while in wait().
>
> Replace the use of signal with sigaction() to ensure that the
> SA_RESTART flag is not set and the EINTR is delivered to the process
> sitting in wait(). This makes test 208 terminate at 200s again.
Yeah, signal is deprecated in favour of sigaction for a reason..
Reviewed-by: Christoph Hellwig <hch at lst.de>
More information about the xfs
mailing list