chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix order and document user unit dirs
[elogind.git]
/
src
/
shared
/
watchdog.c
diff --git
a/src/shared/watchdog.c
b/src/shared/watchdog.c
index 13265e76929d0d8b8e80353fb59c2baa5e048b22..7d188d98e821892a1ef09ef9d55517a129551a61 100644
(file)
--- a/
src/shared/watchdog.c
+++ b/
src/shared/watchdog.c
@@
-29,7
+29,7
@@
#include "log.h"
static int watchdog_fd = -1;
#include "log.h"
static int watchdog_fd = -1;
-static usec_t watchdog_timeout =
(usec_t) -1
;
+static usec_t watchdog_timeout =
USEC_INFINITY
;
static int update_timeout(void) {
int r;
static int update_timeout(void) {
int r;
@@
-37,7
+37,7
@@
static int update_timeout(void) {
if (watchdog_fd < 0)
return 0;
if (watchdog_fd < 0)
return 0;
- if (watchdog_timeout ==
(usec_t) -1
)
+ if (watchdog_timeout ==
USEC_INFINITY
)
return 0;
else if (watchdog_timeout == 0) {
int flags;
return 0;
else if (watchdog_timeout == 0) {
int flags;
@@
-60,7
+60,7
@@
static int update_timeout(void) {
}
watchdog_timeout = (usec_t) sec * USEC_PER_SEC;
}
watchdog_timeout = (usec_t) sec * USEC_PER_SEC;
- log_info("Set hardware watchdog to %s.", format_timespan(buf, sizeof(buf), watchdog_timeout));
+ log_info("Set hardware watchdog to %s.", format_timespan(buf, sizeof(buf), watchdog_timeout
, 0
));
flags = WDIOS_ENABLECARD;
r = ioctl(watchdog_fd, WDIOC_SETOPTIONS, &flags);
flags = WDIOS_ENABLECARD;
r = ioctl(watchdog_fd, WDIOC_SETOPTIONS, &flags);
@@
-104,7
+104,7
@@
int watchdog_set_timeout(usec_t *usec) {
/* If we didn't open the watchdog yet and didn't get any
* explicit timeout value set, don't do anything */
/* If we didn't open the watchdog yet and didn't get any
* explicit timeout value set, don't do anything */
- if (watchdog_fd < 0 && watchdog_timeout ==
(usec_t) -1
)
+ if (watchdog_fd < 0 && watchdog_timeout ==
USEC_INFINITY
)
return 0;
if (watchdog_fd < 0)
return 0;
if (watchdog_fd < 0)
@@
-164,6
+164,5
@@
void watchdog_close(bool disarm) {
}
}
}
}
- close_nointr_nofail(watchdog_fd);
- watchdog_fd = -1;
+ watchdog_fd = safe_close(watchdog_fd);
}
}