Skip to content

Commit c0bb20c

Browse files
committed
fix unlink in container
Deleting files returns STATUS_INVALID_PARAMETE on a bind mounted file system in hyper-v container with FILE_DISPOSITION_POSIX_SEMANTICS. Therefore fall back to default method. This code is suggeted by dscho and I change it more simple.
1 parent 9acb704 commit c0bb20c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

winsup/cygwin/syscalls.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -731,7 +731,10 @@ _unlink_nt (path_conv &pc, bool shareable)
731731
/* Trying to delete in-use executables and DLLs using
732732
FILE_DISPOSITION_POSIX_SEMANTICS returns STATUS_CANNOT_DELETE.
733733
Fall back to the default method. */
734-
if (status != STATUS_CANNOT_DELETE)
734+
/* Additionaly that returns STATUS_INVALID_PARAMETER
735+
on a bind mounted fs in hyper-v container. Falling back too. */
736+
if (status != STATUS_CANNOT_DELETE
737+
&& status != STATUS_INVALID_PARAMETER)
735738
goto out;
736739
}
737740

0 commit comments

Comments
 (0)