diff options
author | Henrique de Moraes Holschuh <hmh@hmh.eng.br> | 2008-10-09 17:15:29 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-10-31 19:00:08 -0400 |
commit | cf4b4aab552f5f658ed400dd0cd41f9ac8aac7c1 (patch) | |
tree | ae4d83e4d7b1f2ec868c46e37578128502aadec2 /net | |
parent | e8975581f63870be42ff4662b293d1b0c8c21350 (diff) |
rfkill: use killable locks instead of interruptible
Apparently, many applications don't expect to get EAGAIN from fd read/write
operations, since POSIX doesn't mandate it.
Use mutex_lock_killable instead of mutex_lock_interruptible, which won't
cause issues.
Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Cc: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/rfkill/rfkill.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/net/rfkill/rfkill.c b/net/rfkill/rfkill.c index f949a482b007..08be968f578d 100644 --- a/net/rfkill/rfkill.c +++ b/net/rfkill/rfkill.c | |||
@@ -431,8 +431,9 @@ static ssize_t rfkill_state_store(struct device *dev, | |||
431 | state != RFKILL_STATE_SOFT_BLOCKED) | 431 | state != RFKILL_STATE_SOFT_BLOCKED) |
432 | return -EINVAL; | 432 | return -EINVAL; |
433 | 433 | ||
434 | if (mutex_lock_interruptible(&rfkill->mutex)) | 434 | error = mutex_lock_killable(&rfkill->mutex); |
435 | return -ERESTARTSYS; | 435 | if (error) |
436 | return error; | ||
436 | error = rfkill_toggle_radio(rfkill, state, 0); | 437 | error = rfkill_toggle_radio(rfkill, state, 0); |
437 | mutex_unlock(&rfkill->mutex); | 438 | mutex_unlock(&rfkill->mutex); |
438 | 439 | ||
@@ -472,7 +473,7 @@ static ssize_t rfkill_claim_store(struct device *dev, | |||
472 | * Take the global lock to make sure the kernel is not in | 473 | * Take the global lock to make sure the kernel is not in |
473 | * the middle of rfkill_switch_all | 474 | * the middle of rfkill_switch_all |
474 | */ | 475 | */ |
475 | error = mutex_lock_interruptible(&rfkill_global_mutex); | 476 | error = mutex_lock_killable(&rfkill_global_mutex); |
476 | if (error) | 477 | if (error) |
477 | return error; | 478 | return error; |
478 | 479 | ||