From bcd7cdf13036eb4e57351c2a168799fe47dd7fd6 Mon Sep 17 00:00:00 2001 From: Frans Pop Date: Mon, 22 Jun 2009 11:08:36 +0200 Subject: [PATCH] --- yaml --- r: 164557 b: refs/heads/master c: b519c15d4aacb3706bfff86ba316f9ed81b5032a h: refs/heads/master i: 164555: fccef147c4742134ed93968a7e855aa9df236cbd v: v3 --- [refs] | 2 +- trunk/Documentation/hwmon/hpfall.c | 64 +++++++++++++++--------------- 2 files changed, 32 insertions(+), 34 deletions(-) diff --git a/[refs] b/[refs] index 09ced2b5b31a..f87461f38d27 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: cf83011d8faec99de51d6ba8879c0c61cf31e836 +refs/heads/master: b519c15d4aacb3706bfff86ba316f9ed81b5032a diff --git a/trunk/Documentation/hwmon/hpfall.c b/trunk/Documentation/hwmon/hpfall.c index bbea1ccfd46a..d2f6711b468b 100644 --- a/trunk/Documentation/hwmon/hpfall.c +++ b/trunk/Documentation/hwmon/hpfall.c @@ -57,45 +57,43 @@ void ignore_me(void) { protect(0); set_led(0); - } -int main(int argc, char* argv[]) +int main(int argc, char *argv[]) { - int fd, ret; + int fd, ret; - fd = open("/dev/freefall", O_RDONLY); - if (fd < 0) { - perror("open"); - return EXIT_FAILURE; - } + fd = open("/dev/freefall", O_RDONLY); + if (fd < 0) { + perror("open"); + return EXIT_FAILURE; + } signal(SIGALRM, ignore_me); - for (;;) { - unsigned char count; - - ret = read(fd, &count, sizeof(count)); - alarm(0); - if ((ret == -1) && (errno == EINTR)) { - /* Alarm expired, time to unpark the heads */ - continue; - } - - if (ret != sizeof(count)) { - perror("read"); - break; - } - - protect(21); - set_led(1); - if (1 || on_ac() || lid_open()) { - alarm(2); - } else { - alarm(20); - } - } + for (;;) { + unsigned char count; + + ret = read(fd, &count, sizeof(count)); + alarm(0); + if ((ret == -1) && (errno == EINTR)) { + /* Alarm expired, time to unpark the heads */ + continue; + } + + if (ret != sizeof(count)) { + perror("read"); + break; + } + + protect(21); + set_led(1); + if (1 || on_ac() || lid_open()) + alarm(2); + else + alarm(20); + } - close(fd); - return EXIT_SUCCESS; + close(fd); + return EXIT_SUCCESS; }