ACPI: thinkpad-acpi: allow for syscall restart in sysfs handlers
commit67f0f925cac6998954f0134e9fa453caa4861f15
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>
Tue, 30 Oct 2007 22:47:53 +0000 (30 20:47 -0200)
tree52d1c06acded4c018f5a62f4d05e95ebae33c7c7
parent58784750f267213c5c07a23268908b86a1d94fa2
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