aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHimbeerserverDE <himbeerserverde@gmail.com>2023-08-24 11:30:10 +0200
committerHimbeerserverDE <himbeerserverde@gmail.com>2023-08-24 11:30:10 +0200
commitb7d1a99bd434ab7a6c1be4151ff330ffc1c0d0a6 (patch)
tree2714348fe5b40cc915f23cb760775e226097898d
parent1cc27a1e00338e6d2db8904138e0704169aa8cd8 (diff)
don't update cmdline twice during an update
-rw-r--r--src/main.rs16
1 files changed, 2 insertions, 14 deletions
diff --git a/src/main.rs b/src/main.rs
index b6789f3..75c49ae 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -65,24 +65,12 @@ async fn handle_update_boot(data: web::Bytes) -> HttpResponse {
};
match stream_to(boot, &data).await {
- Ok(_) => {}
- Err(e) => {
- return HttpResponse::InternalServerError()
- .content_type(ContentType::plaintext())
- .body(format!("can't update boot partition: {}", e))
- }
- }
-
- match switch_to_inactive_root() {
Ok(_) => HttpResponse::Ok()
.content_type(ContentType::plaintext())
- .body("successfully updated boot partition and switched to inactive root"),
+ .body("successfully updated boot partition"),
Err(e) => HttpResponse::InternalServerError()
.content_type(ContentType::plaintext())
- .body(format!(
- "can't switch to inactive root (this is probably fatal): {}",
- e
- )),
+ .body(format!("can't update boot partition: {}", e)),
}
}