summaryrefslogtreecommitdiff
path: root/kvmd/apps/watchdog/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'kvmd/apps/watchdog/__init__.py')
-rw-r--r--kvmd/apps/watchdog/__init__.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/kvmd/apps/watchdog/__init__.py b/kvmd/apps/watchdog/__init__.py
index 953168cd..e7271ac1 100644
--- a/kvmd/apps/watchdog/__init__.py
+++ b/kvmd/apps/watchdog/__init__.py
@@ -57,7 +57,12 @@ def _write_int(rtc: int, key: str, value: int) -> None:
def _reset_alarm(rtc: int, timeout: int) -> None:
- now = _read_int(rtc, "since_epoch")
+ try:
+ now = _read_int(rtc, "since_epoch")
+ except OSError as err:
+ if err.errno != errno.EINVAL:
+ raise
+ raise RtcIsNotAvailableError("Can't read since_epoch right now")
if now == 0:
raise RtcIsNotAvailableError("Current UNIX time == 0")
try: