Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 312729
b: refs/heads/master
c: 11388c8
h: refs/heads/master
i:
  312727: eab5610
v: v3
  • Loading branch information
Rafael J. Wysocki committed Jul 18, 2012
1 parent 7abf142 commit 24e606c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 823d93640927d739f7c918b73fe5ec494fb27e17
refs/heads/master: 11388c87d2abca1f01975ced28ce9eacea239104
7 changes: 7 additions & 0 deletions trunk/kernel/power/wakelock.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* manipulate wakelocks on Android.
*/

#include <linux/capability.h>
#include <linux/ctype.h>
#include <linux/device.h>
#include <linux/err.h>
Expand Down Expand Up @@ -188,6 +189,9 @@ int pm_wake_lock(const char *buf)
size_t len;
int ret = 0;

if (!capable(CAP_BLOCK_SUSPEND))
return -EPERM;

while (*str && !isspace(*str))
str++;

Expand Down Expand Up @@ -231,6 +235,9 @@ int pm_wake_unlock(const char *buf)
size_t len;
int ret = 0;

if (!capable(CAP_BLOCK_SUSPEND))
return -EPERM;

len = strlen(buf);
if (!len)
return -EINVAL;
Expand Down

0 comments on commit 24e606c

Please sign in to comment.