ACPI: thinkpad-acpi: allow for syscall restart in sysfs handlers
commit8358837621ad5d957f6c596fb081903426999a9a
authorHenrique de Moraes Holschuh <hmh@hmh.eng.br>
Sat, 13 Oct 2007 10:03:11 +0000 (13 07:03 -0300)
committerHenrique de Moraes Holschuh <hmh@hmh.eng.br>
Mon, 12 Nov 2007 11:00:01 +0000 (12 09:00 -0200)
tree23897357362ac622e45ac4f5b0550aad15e5a87d
parent75ce969efff4a1c2348510e1df1ba9e0aefced76
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