[Title] reject OS suspend in emulator
authorSon Hyunjun <hj79.son@samsung.com>
Sun, 1 Apr 2012 06:57:02 +0000 (15:57 +0900)
committerSon Hyunjun <hj79.son@samsung.com>
Sun, 1 Apr 2012 06:57:02 +0000 (15:57 +0900)
[Type] Bugfix
[Module] Power
[Priority] Major
[CQ#]
[Redmine#]
[Problem] some side-effects occurs in socket communicating with the guest during suspend.
[Cause]
[Solution]

Change-Id: I27135ecb26f83bf1d474a5090d7e8f5784a50bc5

kernel/power/main.c

index 347d2cc88cd0e1a824f1004c4288d5d4a8e2959c..db758dc397da9d83e6e38ce04b908cbf8f09207d 100644 (file)
@@ -146,6 +146,8 @@ static ssize_t state_show(struct kobject *kobj, struct kobj_attribute *attr,
 static ssize_t state_store(struct kobject *kobj, struct kobj_attribute *attr,
                           const char *buf, size_t n)
 {
+#if 0 // do not allow suspend in emulator
+
 #ifdef CONFIG_SUSPEND
        suspend_state_t state = PM_SUSPEND_STANDBY;
        const char * const *s;
@@ -174,6 +176,11 @@ static ssize_t state_store(struct kobject *kobj, struct kobj_attribute *attr,
 
  Exit:
        return error ? error : n;
+#else
+
+       return n;
+
+#endif // do not allow suspend in emulator
 }
 
 power_attr(state);