summaryrefslogtreecommitdiff
path: root/bin/rdsquashfs/restore_fstree.c
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2020-08-26 18:23:35 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2020-08-26 18:23:35 +0200
commit4afd9632251a8c050a44e8cad8fc2ccc45a35a2a (patch)
tree49d72f2081bce303a7353a36a1af045c53076040 /bin/rdsquashfs/restore_fstree.c
parentce8d6217fe7ed4d40af23242be4eaef8e53385a3 (diff)
Fix rdsquashfs unpack under Windows if a directory exists
Behave the same way as the POSIX port and do not treat that as an error. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'bin/rdsquashfs/restore_fstree.c')
-rw-r--r--bin/rdsquashfs/restore_fstree.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/bin/rdsquashfs/restore_fstree.c b/bin/rdsquashfs/restore_fstree.c
index e79f333..3d536b6 100644
--- a/bin/rdsquashfs/restore_fstree.c
+++ b/bin/rdsquashfs/restore_fstree.c
@@ -19,8 +19,10 @@ static int create_node(const sqfs_tree_node_t *n, const char *name, int flags)
switch (n->inode->base.mode & S_IFMT) {
case S_IFDIR:
- if (!CreateDirectoryW(wpath, NULL))
- goto fail;
+ if (!CreateDirectoryW(wpath, NULL)) {
+ if (GetLastError() != ERROR_ALREADY_EXISTS)
+ goto fail;
+ }
break;
case S_IFREG:
fh = CreateFileW(wpath, GENERIC_READ,