فهرست منبع

* Delete temporary file when auto update fails

Bryan Drewery 16 سال پیش
والد
کامیت
d63415ce80
1فایلهای تغییر یافته به همراه3 افزوده شده و 2 حذف شده
  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;
 }