projects
/
project
/
procd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
only write to the watchdog if the fd is valid
[project/procd.git]
/
watchdog.c
diff --git
a/watchdog.c
b/watchdog.c
index
3c097e2
..
592ae7e
100644
(file)
--- a/
watchdog.c
+++ b/
watchdog.c
@@
-35,7
+35,7
@@
static int wdt_frequency = 5;
void watchdog_ping(void)
{
DEBUG(4, "Ping\n");
- if (write(wdt_fd, "X", 1) < 0)
+ if (w
dt_fd >= 0 && w
rite(wdt_fd, "X", 1) < 0)
ERROR("WDT failed to write: %s\n", strerror(errno));
}