Ver Fonte

* Delete temporary file when auto update fails

Bryan Drewery há 16 anos atrás
pai
commit
d63415ce80
1 ficheiros alterados com 3 adições e 2 exclusões
  1. 3 2
      src/mod/update.mod/update.c

+ 3 - 2
src/mod/update.mod/update.c

@@ -253,9 +253,10 @@ void finish_update_stream(int idx, bd::Stream& stream)
   putlog(LOG_DEBUG, "*", "Update binary is %zu bytes.", stream.length());
   putlog(LOG_MISC, "*", "Updating with binary: %s", buf2);
   
-  if (updatebin(0, buf2, 120))
+  if (updatebin(0, buf2, 120)) {
     putlog(LOG_MISC, "*", "Failed to update to new binary..");
-  else
+    unlink(buf2);
+  } else
     updated = 1;
 }