From 59e932c4b5d6dd2ffd0908c8e3174fea5a04ed79 Mon Sep 17 00:00:00 2001 From: Christian Thaeter Date: Sat, 25 Jul 2009 20:55:15 +0200 Subject: [PATCH] --- yaml --- r: 164573 b: refs/heads/master c: 2bace8b95108746f6123d312f47f5bda4eb17a26 h: refs/heads/master i: 164571: 6361c00892343304f530ca8d7141d2b869a80338 v: v3 --- [refs] | 2 +- trunk/Documentation/hwmon/hpfall.c | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index ec1e88816602..ebe5eb57455e 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 8103b5cc6216d461047514d188248bd14873624a +refs/heads/master: 2bace8b95108746f6123d312f47f5bda4eb17a26 diff --git a/trunk/Documentation/hwmon/hpfall.c b/trunk/Documentation/hwmon/hpfall.c index d2f6711b468b..a3cfe1a5f964 100644 --- a/trunk/Documentation/hwmon/hpfall.c +++ b/trunk/Documentation/hwmon/hpfall.c @@ -16,6 +16,8 @@ #include #include #include +#include +#include void write_int(char *path, int i) { @@ -62,6 +64,7 @@ void ignore_me(void) int main(int argc, char *argv[]) { int fd, ret; + struct sched_param param; fd = open("/dev/freefall", O_RDONLY); if (fd < 0) { @@ -69,6 +72,11 @@ int main(int argc, char *argv[]) return EXIT_FAILURE; } + daemon(0, 0); + param.sched_priority = sched_get_priority_max(SCHED_FIFO); + sched_setscheduler(0, SCHED_FIFO, ¶m); + mlockall(MCL_CURRENT|MCL_FUTURE); + signal(SIGALRM, ignore_me); for (;;) {