diff --git a/native/jni/utils/cpio.cpp b/native/jni/utils/cpio.cpp index c85ad8a9b..478475d8b 100644 --- a/native/jni/utils/cpio.cpp +++ b/native/jni/utils/cpio.cpp @@ -66,8 +66,7 @@ cpio_entry::~cpio_entry() { void cpio::dump(const char *file) { fprintf(stderr, "Dump cpio: [%s]\n", file); - int fd = xopen(file, O_WRONLY | O_CREAT, 0644); - FDOutStream fd_out(fd, true); + FDOutStream fd_out(xopen(file, O_WRONLY | O_CREAT | O_TRUNC, 0644), true); output(fd_out); }