Utilities/tar: Ignore directory entry if it already exists

This commit is contained in:
Tim Schumacher 2021-11-13 01:28:17 +01:00 committed by Andreas Kling
parent 1ae76676a5
commit c94574d313
Notes: sideshowbarker 2024-07-18 01:13:17 +09:00

View file

@ -102,7 +102,7 @@ int main(int argc, char** argv)
case Archive::TarFileType::Directory: {
Core::File::ensure_parent_directories(absolute_path);
if (mkdir(absolute_path.characters(), header.mode())) {
if (mkdir(absolute_path.characters(), header.mode()) && errno != EEXIST) {
perror("mkdir");
return 1;
}