Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Preserve timestamps when extracting the squashfs #1

Merged
merged 1 commit into from
Sep 29, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/runtime/runtime.c
Original file line number Diff line number Diff line change
Expand Up @@ -764,6 +764,11 @@ bool extract_appimage(const char* const appimage_path, const char* const _prefix
fwrite(buf, 1, bytes_at_a_time, f);
bytes_already_read = bytes_already_read + bytes_at_a_time;
}
fflush(f);
int fd = fileno(f);
struct timespec times[] = { st.st_atim, st.st_mtim };
if (futimens(fd, times) != 0)
fprintf(stderr, "futimens: %s\n", strerror(errno));
fclose(f);
chmod(prefixed_path_to_extract, st.st_mode);
if (!rv)
Expand Down