ACPI: thinkpad-acpi: allow for syscall restart in sysfs handlers
commit2133d78f48cde75a067b4a071dae24430245ecb3
authorHenrique de Moraes Holschuh <hmh@hmh.eng.br>
Sat, 13 Oct 2007 07:03:11 +0000 (13 04:03 -0300)
committerHenrique de Moraes Holschuh <hmh@hmh.eng.br>
Mon, 11 Feb 2008 17:22:06 +0000 (11 15:22 -0200)
tree7d79dfb9afc9e7d6ad4bddf0263fd181e0f2d877
parent72e2bef053648e8e9f06ae0eb2cb57a2f3dd25c7
ACPI: thinkpad-acpi: allow for syscall restart in sysfs handlers

Map an mutex_lock_interruptible() error return into ERESTARTSYS, as the
only possible error from mutex_lock_interruptible is EINTR, and that will
only happen if signal_pending() causes the mutex lock attempt to abort.

This still allows signals to be delivered ASAP, which is much nicer than
just doing mutex_lock, and still shadows userspace from EINTR when
SA_RESTART is active.

Problem reported by Peter Jordan.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Cc: Jean Delvare <khali@linux-fr.org>
Cc: Peter Jordan <usernetwork@gmx.info>
Cc: Richard Neill <rn214@hermes.cam.ac.uk>
drivers/misc/thinkpad_acpi.c