summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Mittendrein <git@maxmitti.tk>2019-04-20 22:08:18 +0200
committerMarkus Mittendrein <git@maxmitti.tk>2019-04-20 22:08:18 +0200
commite6186887f4316ebbd8f8f281b81aa54611a44048 (patch)
tree28d1169f007e31a547d822de7202a15281f35088
parent70a0ccbcc1a1e029e9d41e10f292ca320a4c3417 (diff)
downloadcc4group-e6186887f4316ebbd8f8f281b81aa54611a44048.tar.gz
cc4group-e6186887f4316ebbd8f8f281b81aa54611a44048.zip
Also restore modification time for directories when extracting
-rw-r--r--src/cc4group.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/cc4group.c b/src/cc4group.c
index 85bc48b..5b3e888 100644
--- a/src/cc4group.c
+++ b/src/cc4group.c
@@ -1355,6 +1355,12 @@ static bool cc4group_extractChildren(CC4Group* const this, const C4GroupEntryDat
}
}
+ struct utimbuf times = {.actime = root->header->Creation, .modtime = root->header->Creation};
+ if(utime(tmpPath, &times) == -1)
+ {
+ fprintf(stderr, "WARNING: utime: Setting modification time for \"%s\" failed: %s\n", tmpPath, strerror(errno));
+ }
+
success = true;
goto ret;
}