mirror of
https://github.com/mhx/dwarfs.git
synced 2025-09-14 14:59:52 -04:00
More Windows fixes
This commit is contained in:
parent
1a58fece57
commit
3b602a2984
@ -81,7 +81,7 @@ struct file_stat {
|
||||
time_type ctime;
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
template <bool with_block_info = true, typename T>
|
||||
void copy_file_stat(T* out, file_stat const& in) {
|
||||
out->st_dev = in.dev;
|
||||
out->st_ino = in.ino;
|
||||
@ -91,8 +91,10 @@ void copy_file_stat(T* out, file_stat const& in) {
|
||||
out->st_gid = in.gid;
|
||||
out->st_rdev = in.rdev;
|
||||
out->st_size = in.size;
|
||||
out->st_blksize = in.blksize;
|
||||
out->st_blocks = in.blocks;
|
||||
if constexpr (with_block_info) {
|
||||
out->st_blksize = in.blksize;
|
||||
out->st_blocks = in.blocks;
|
||||
}
|
||||
out->st_atime = in.atime;
|
||||
out->st_mtime = in.mtime;
|
||||
out->st_ctime = in.ctime;
|
||||
|
@ -336,7 +336,11 @@ bool filesystem_extractor_<LoggerPolicy>::extract(
|
||||
struct stat st;
|
||||
|
||||
::memset(&st, 0, sizeof(st));
|
||||
copy_file_stat(&st, stbuf);
|
||||
#ifdef _WIN32
|
||||
copy_file_stat<false>(&st, stbuf);
|
||||
#else
|
||||
copy_file_stat<true>(&st, stbuf);
|
||||
#endif
|
||||
|
||||
::archive_entry_set_pathname(ae, entry.path().c_str());
|
||||
::archive_entry_copy_stat(ae, &st);
|
||||
|
Loading…
x
Reference in New Issue
Block a user