Merge "Adding const to task constructors"
diff --git a/fastboot/fastboot.cpp b/fastboot/fastboot.cpp
index 0967632..d7d2091 100644
--- a/fastboot/fastboot.cpp
+++ b/fastboot/fastboot.cpp
@@ -2254,7 +2254,7 @@
             if (args.size() == 1) {
                 std::string reboot_target = next_arg(&args);
                 reboot_task = std::make_unique<RebootTask>(fp.get(), reboot_target);
-            } else {
+            } else if (!fp->skip_reboot) {
                 reboot_task = std::make_unique<RebootTask>(fp.get());
             }
             if (!args.empty()) syntax_error("junk after reboot command");
@@ -2309,7 +2309,9 @@
             } else {
                 do_flashall(fp.get());
             }
-            reboot_task = std::make_unique<RebootTask>(fp.get());
+            if (!fp->skip_reboot) {
+                reboot_task = std::make_unique<RebootTask>(fp.get());
+            }
         } else if (command == "update") {
             bool slot_all = (fp->slot_override == "all");
             if (slot_all) {
@@ -2321,7 +2323,9 @@
                 filename = next_arg(&args);
             }
             do_update(filename.c_str(), fp.get());
-            reboot_task = std::make_unique<RebootTask>(fp.get());
+            if (!fp->skip_reboot) {
+                reboot_task = std::make_unique<RebootTask>(fp.get());
+            }
         } else if (command == FB_CMD_SET_ACTIVE) {
             std::string slot = verify_slot(next_arg(&args), false);
             fb->SetActive(slot);
@@ -2410,7 +2414,7 @@
     if (fp->wants_set_active) {
         fb->SetActive(next_active);
     }
-    if (reboot_task && !fp->skip_reboot) {
+    if (reboot_task) {
         reboot_task->Run();
     }
     fprintf(stderr, "Finished. Total time: %.3fs\n", (now() - start));