projects
/
oweals
/
procd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
40c4e68
)
only write to the watchdog if the fd is valid
author
John Crispin
<blogic@openwrt.org>
Sun, 14 Dec 2014 21:12:45 +0000
(22:12 +0100)
committer
John Crispin
<blogic@openwrt.org>
Sun, 14 Dec 2014 21:28:55 +0000
(22:28 +0100)
Signed-off-by: John Crispin <blogic@openwrt.org>
watchdog.c
patch
|
blob
|
history
diff --git
a/watchdog.c
b/watchdog.c
index 3c097e2273c55c34f90c251588aa0630a64f7299..592ae7e74f771472ef7a670f8badbac1084d4ed5 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));
}