summaryrefslogtreecommitdiffstats
path: root/crates/core/tedge_agent/src
diff options
context:
space:
mode:
authorinitard <solo@softwareag.com>2022-03-08 14:08:58 +0000
committerinitard <solo@softwareag.com>2022-03-10 12:48:37 +0000
commit30c6ec1478c050a75fa909c5320a9c6431b2c616 (patch)
tree397d72042f9e5fb352a8525a8ed094b96c56ed71 /crates/core/tedge_agent/src
parentdd607148665cbaea265211f1442c7ec8e01cc604 (diff)
fixed /run path bug introduced by #939
- updated /run default configuration to use /run Signed-off-by: initard <solo@softwareag.com>
Diffstat (limited to 'crates/core/tedge_agent/src')
-rw-r--r--crates/core/tedge_agent/src/restart_operation_handler.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/core/tedge_agent/src/restart_operation_handler.rs b/crates/core/tedge_agent/src/restart_operation_handler.rs
index 0873c43d..ed1b46ab 100644
--- a/crates/core/tedge_agent/src/restart_operation_handler.rs
+++ b/crates/core/tedge_agent/src/restart_operation_handler.rs
@@ -46,8 +46,8 @@ pub mod restart_operation {
}
/// returns the datetime of `SLASH_RUN_PATH_TEDGE_AGENT_RESTART` "modified at".
- fn get_restart_file_datetime() -> Result<time::OffsetDateTime, AgentError> {
- let mut file = File::open(&SLASH_RUN_PATH_TEDGE_AGENT_RESTART)?;
+ fn get_restart_file_datetime(run_dir: &PathBuf) -> Result<time::OffsetDateTime, AgentError> {
+ let mut file = File::open(&run_dir.join(SLASH_RUN_PATH_TEDGE_AGENT_RESTART))?;
let mut contents = String::new();
file.read_to_string(&mut contents)?;
@@ -108,7 +108,7 @@ pub mod restart_operation {
}
let system_reboot_dt = get_system_uptime()?;
- let tedge_restart_file_dt = get_restart_file_datetime()?;
+ let tedge_restart_file_dt = get_restart_file_datetime(&run_dir)?;
Ok(system_reboot_dt > tedge_restart_file_dt)
}