diff options
| author | mattis fjallstrom <mattis@acm.org> | 2016-02-12 18:17:54 -0800 |
|---|---|---|
| committer | mattis fjallstrom <mattis@acm.org> | 2016-02-12 18:19:25 -0800 |
| commit | 8eb9e51a418796811b552ee3cf7958b84df01b01 (patch) | |
| tree | a8944fc3486b5e8cb6c4d3c243c287914efb44be | |
| parent | 300fe054140b75c5a7bc3c53077b3c4c200e82b9 (diff) | |
| download | olio-linux-3.10-8eb9e51a418796811b552ee3cf7958b84df01b01.tar.xz olio-linux-3.10-8eb9e51a418796811b552ee3cf7958b84df01b01.zip | |
At Olio, where we don't allow outside applications, anything that tries to set a wakelock is allowed to do so. We remove the permission checks since they return incorrect values.
Change-Id: Ia8f1929bd0dbbfd8ac56c63a09f689c32aefd0ef
| -rw-r--r-- | kernel/power/wakelock.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/kernel/power/wakelock.c b/kernel/power/wakelock.c index 8f50de394d2..ee83a3c5047 100644 --- a/kernel/power/wakelock.c +++ b/kernel/power/wakelock.c @@ -189,21 +189,26 @@ int pm_wake_lock(const char *buf) size_t len; int ret = 0; - if (!capable(CAP_BLOCK_SUSPEND)) +#if 0 /* OLIO our watch is entirely controlled by us, no need for this */ + if (!capable(CAP_BLOCK_SUSPEND)) { + printk ("OLIO %s error return 1, lock %s\n", __FUNCTION__, buf); return -EPERM; + } +#endif while (*str && !isspace(*str)) str++; len = str - buf; - if (!len) + if (!len) { return -EINVAL; - + } if (*str && *str != '\n') { /* Find out if there's a valid timeout string appended. */ ret = kstrtou64(skip_spaces(str), 10, &timeout_ns); - if (ret) + if (ret) { return -EINVAL; + } } mutex_lock(&wakelocks_lock); @@ -235,8 +240,10 @@ int pm_wake_unlock(const char *buf) size_t len; int ret = 0; +#if 0 /* OLIO our watch is entirely controlled by us, no need for this */ if (!capable(CAP_BLOCK_SUSPEND)) return -EPERM; +#endif len = strlen(buf); if (!len) |