Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 305892
b: refs/heads/master
c: cad19fa
h: refs/heads/master
v: v3
  • Loading branch information
Devendra Naga authored and Wim Van Sebroeck committed May 23, 2012
1 parent dfbc215 commit 5dec05e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3c2a6186c1a69d647e3a48ad3f7f9078c451111e
refs/heads/master: cad19fa66469d2a745fae0c168833d5d33d64489
11 changes: 11 additions & 0 deletions trunk/Documentation/watchdog/src/watchdog-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include <signal.h>
#include <sys/ioctl.h>
#include <linux/types.h>
#include <linux/watchdog.h>
Expand All @@ -29,6 +30,14 @@ static void keep_alive(void)
* The main program. Run the program with "-d" to disable the card,
* or "-e" to enable the card.
*/

void term(int sig)
{
close(fd);
fprintf(stderr, "Stopping watchdog ticks...\n");
exit(0);
}

int main(int argc, char *argv[])
{
int flags;
Expand Down Expand Up @@ -65,6 +74,8 @@ int main(int argc, char *argv[])
fflush(stderr);
}

signal(SIGINT, term);

while(1) {
keep_alive();
sleep(1);
Expand Down

0 comments on commit 5dec05e

Please sign in to comment.