summaryrefslogtreecommitdiffstats
path: root/meta/recipes-bsp/apmd/apmd-3.2.2-14/workaround.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-bsp/apmd/apmd-3.2.2-14/workaround.patch')
-rw-r--r--meta/recipes-bsp/apmd/apmd-3.2.2-14/workaround.patch59
1 files changed, 59 insertions, 0 deletions
diff --git a/meta/recipes-bsp/apmd/apmd-3.2.2-14/workaround.patch b/meta/recipes-bsp/apmd/apmd-3.2.2-14/workaround.patch
new file mode 100644
index 0000000000..d37380397c
--- /dev/null
+++ b/meta/recipes-bsp/apmd/apmd-3.2.2-14/workaround.patch
@@ -0,0 +1,59 @@
1# this workaround is there in OE since 2003. It looks to provide a workaround
2# allowing others sending SIGUSR1 to cause an apm suspend event. Disable it for
3# now.
4#
5# comment added by Kevin Tian <kevin.tian@intel.com>, 2010-07-13
6#
7# Patch managed by http://www.holgerschurig.de/patcher.html
8#
9
10--- apmd-3.2.2.orig/apmd.c~workaround.patch
11+++ apmd-3.2.2.orig/apmd.c
12@@ -158,6 +158,7 @@
13 static int quiet_bios_batlow; /* = 0 */
14 static int verbosity = DEFAULT_VERBOSITY;
15 static int warn_level = 10;
16+static int sleep_now = 0; /* ntp */
17
18 static uid_t apmd_uid = 0;
19 static int apmd_fd = -1;
20@@ -942,6 +943,12 @@
21 exit(0);
22 }
23
24+/* ntp */
25+static void sig_usr1(int sig)
26+{
27+ sleep_now = 1;
28+}
29+
30 int main(int argc, char **argv)
31 {
32 int c;
33@@ -1151,6 +1158,8 @@
34 openlog("apmd", (verbosity>=LOG_DEBUG)?LOG_PERROR:0 | LOG_PID | LOG_CONS, LOG_DAEMON);
35
36 /* Set up signal handler */
37+ if (signal(SIGUSR1, SIG_IGN) != SIG_IGN)
38+ signal(SIGUSR1, sig_usr1); /* ntp */
39 if (signal(SIGINT, SIG_IGN) != SIG_IGN)
40 signal(SIGINT, sig_handler);
41 if (signal(SIGQUIT, SIG_IGN) != SIG_IGN)
42@@ -1230,9 +1239,16 @@
43
44 for (;;)
45 {
46- int num_events = apm_get_events(apmd_fd, check_interval, events, MAX_EVENTS);
47+ int num_events;
48 int e, a;
49
50+ /* ntp */
51+ if (sleep_now) {
52+ sleep_now = 0;
53+ handle_event(APM_USER_SUSPEND, &apminfo);
54+ }
55+
56+ num_events = apm_get_events(apmd_fd, check_interval, events, MAX_EVENTS);
57 apm_read(&apminfo);
58
59 if (num_events == 0) {