ACPI: thinkpad-acpi: allow for syscall restart in sysfs handlers
commitbf46da0569afc4f9d9163f92b80c947a5170d08f
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, 26 Feb 2008 02:34:07 +0000 (25 23:34 -0300)
tree235e0355d596592594fe3435bc0582ac28237b16
parent49c23305ca7adb99935cb1153010c50e4667f598
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