summaryrefslogtreecommitdiffstats
path: root/meta/recipes-bsp/acpid/acpid
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-bsp/acpid/acpid')
-rwxr-xr-xmeta/recipes-bsp/acpid/acpid/init31
-rw-r--r--meta/recipes-bsp/acpid/acpid/set_socket_noblock.patch10
2 files changed, 41 insertions, 0 deletions
diff --git a/meta/recipes-bsp/acpid/acpid/init b/meta/recipes-bsp/acpid/acpid/init
new file mode 100755
index 0000000000..40ff385c10
--- /dev/null
+++ b/meta/recipes-bsp/acpid/acpid/init
@@ -0,0 +1,31 @@
1#! /bin/sh -e
2
3test -x /usr/sbin/acpid || exit 0
4test -d /proc/acpi || exit 0
5mkdir -p /etc/acpi/events
6
7case "$1" in
8 start)
9 echo -n "Starting Advanced Configuration and Power Interface daemon: "
10 if [ ! -d /etc/acpi/events ]; then
11 echo "There is not any rule configuration file."
12 else
13 start-stop-daemon -o -S -x /usr/sbin/acpid -- -c /etc/acpi/events
14 echo "acpid."
15 fi
16 ;;
17 stop)
18 echo -n "Stopping Advanced Configuration and Power Interface daemon: "
19 start-stop-daemon -o -K -x /usr/sbin/acpid
20 echo "acpid."
21 ;;
22 restart|force-reload)
23 $0 stop
24 $0 start
25 ;;
26 *)
27 echo "Usage: /etc/init.d/acpid {start|stop|restart|force-reload}"
28 exit 1
29esac
30
31exit 0
diff --git a/meta/recipes-bsp/acpid/acpid/set_socket_noblock.patch b/meta/recipes-bsp/acpid/acpid/set_socket_noblock.patch
new file mode 100644
index 0000000000..54d64351d7
--- /dev/null
+++ b/meta/recipes-bsp/acpid/acpid/set_socket_noblock.patch
@@ -0,0 +1,10 @@
1--- a/acpid.c
2+++ b/acpid.c
3@@ -307,6 +307,7 @@ main(int argc, char **argv)
4 non_root_clients++;
5 }
6 fcntl(cli_fd, F_SETFD, FD_CLOEXEC);
7+ fcntl(cli_fd, F_SETFL, O_NONBLOCK);
8 snprintf(buf, sizeof(buf)-1, "%d[%d:%d]",
9 creds.pid, creds.uid, creds.gid);
10 acpid_add_client(cli_fd, buf);