summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--common/fastboot.c12
-rw-r--r--include/fastboot.h2
2 files changed, 14 insertions, 0 deletions
diff --git a/common/fastboot.c b/common/fastboot.c
index 7eb10ac177..2a42fa5b6d 100644
--- a/common/fastboot.c
+++ b/common/fastboot.c
@@ -347,6 +347,18 @@ void fastboot_download_finished(struct fastboot *fb)
fastboot_tx_print(fb, FASTBOOT_MSG_OKAY, "");
}
+void fastboot_abort(struct fastboot *fb)
+{
+ if (fb->download_fd > 0) {
+ close(fb->download_fd);
+ fb->download_fd = 0;
+ }
+
+ fb->active = false;
+
+ unlink(fb->tempname);
+}
+
static void cb_download(struct fastboot *fb, const char *cmd)
{
fb->download_size = simple_strtoul(cmd, NULL, 16);
diff --git a/include/fastboot.h b/include/fastboot.h
index ebcc3b94f2..915aa92822 100644
--- a/include/fastboot.h
+++ b/include/fastboot.h
@@ -78,4 +78,6 @@ int fastboot_tx_print(struct fastboot *fb, enum fastboot_msg_type type,
void fastboot_start_download_generic(struct fastboot *fb);
void fastboot_download_finished(struct fastboot *fb);
void fastboot_exec_cmd(struct fastboot *fb, const char *cmdbuf);
+void fastboot_abort(struct fastboot *fb);
+
#endif