aboutsummaryrefslogtreecommitdiffstats
path: root/samsung-ipc/wakelock.c
diff options
context:
space:
mode:
authorSimon Busch <morphis@gravedo.de>2012-09-21 17:07:08 +0200
committerSimon Busch <morphis@gravedo.de>2012-09-21 17:07:08 +0200
commitb21b7798f433ea38e4eef9bfc852a183ddb92ddd (patch)
tree60d462bb59086dedbaf201ea16f462715147d32a /samsung-ipc/wakelock.c
parentd45c70f61f78c4cca3740a50b48a8658596d941f (diff)
downloadexternal_libsamsung-ipc-b21b7798f433ea38e4eef9bfc852a183ddb92ddd.zip
external_libsamsung-ipc-b21b7798f433ea38e4eef9bfc852a183ddb92ddd.tar.gz
external_libsamsung-ipc-b21b7798f433ea38e4eef9bfc852a183ddb92ddd.tar.bz2
samsung-ipc: cleanup to match common code style
Diffstat (limited to 'samsung-ipc/wakelock.c')
-rw-r--r--samsung-ipc/wakelock.c46
1 files changed, 22 insertions, 24 deletions
diff --git a/samsung-ipc/wakelock.c b/samsung-ipc/wakelock.c
index 8cc8e30..227208b 100644
--- a/samsung-ipc/wakelock.c
+++ b/samsung-ipc/wakelock.c
@@ -26,36 +26,34 @@
static int wake_lock_fd = -1;
static int wake_unlock_fd = -1;
-int wake_lock(char *lock_name) {
- int rc;
- assert(lock_name != NULL);
-
- if (wake_lock_fd < 0) {
- wake_lock_fd = open("/sys/power/wake_lock", O_RDWR);
- }
+int wake_lock(char *lock_name)
+{
+ int rc;
+ assert(lock_name != NULL);
- if (wake_lock_fd < 0) {
- return wake_lock_fd;
- }
+ if (wake_lock_fd < 0)
+ wake_lock_fd = open("/sys/power/wake_lock", O_RDWR);
- rc = write(wake_lock_fd, lock_name, strlen(lock_name));
+ if (wake_lock_fd < 0)
+ return wake_lock_fd;
- return rc;
+ rc = write(wake_lock_fd, lock_name, strlen(lock_name));
+
+ return rc;
}
-int wake_unlock(char *lock_name) {
- int rc;
- assert(lock_name != NULL);
-
- if (wake_unlock_fd < 0) {
- wake_unlock_fd = open("/sys/power/wake_unlock", O_RDWR);
- }
+int wake_unlock(char *lock_name)
+{
+ int rc;
+ assert(lock_name != NULL);
+
+ if (wake_unlock_fd < 0)
+ wake_unlock_fd = open("/sys/power/wake_unlock", O_RDWR);
- if (wake_unlock_fd < 0) {
- return wake_lock_fd;
- }
+ if (wake_unlock_fd < 0)
+ return wake_lock_fd;
- rc = write(wake_unlock_fd, lock_name, strlen(lock_name));
+ rc = write(wake_unlock_fd, lock_name, strlen(lock_name));
- return rc;
+ return rc;
}