Fix meizu compatibility

This commit is contained in:
LoveSy
2021-08-14 13:29:12 +08:00
committed by John Wu
parent 9396288ca2
commit 0dad06cdfe
4 changed files with 56 additions and 28 deletions

View File

@@ -423,7 +423,7 @@ void restore_folder(const char *dir, vector<raw_file> &files) {
mkdirs(path.data(), 0);
} else if (S_ISREG(file.attr.st.st_mode)) {
auto fp = xopen_file(path.data(), "we");
fwrite(file.buf, 1, file.sz, fp.get());
if (fp) fwrite(file.buf, 1, file.sz, fp.get());
} else if (S_ISLNK(file.attr.st.st_mode)) {
symlink((char *)file.buf, path.data());
}