Skip to content

Commit

Permalink
Preserve timestamps when extracting the squashfs (probonopd#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
lalten committed Oct 2, 2022
1 parent 09b0b43 commit 65f7678
Showing 1 changed file with 5 additions and 0 deletions.
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

0 comments on commit 65f7678

Please sign in to comment.