From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2155) id C943E3858D28; Fri, 24 Mar 2023 11:51:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C943E3858D28 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1679658701; bh=4FwtYh0cf6rUKy6u9xU0Dhb/2SZzPwpd5G9IMHHREn8=; h=From:To:Subject:Date:From; b=AZa2INeKjLhnioMqdX1XwFcvuPrtBSBG1w/ffTuAzYq/JIpwFSHhrfoGOObZcCeyc Y7PU8FiUULptiOs5mNgSs7Xsf7k+PIPxBJs6NSRvvdROU+K4jEEr6GxvuTKc3Y5O5f 7gvnyViSWAJxFEAQ6jpusqODXqUAEUhu3oshCgbI= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Corinna Vinschen To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin/main] Cygwin: fix unlink in container X-Act-Checkin: newlib-cygwin X-Git-Author: Yoshinao Muramatsu X-Git-Refname: refs/heads/main X-Git-Oldrev: fe2545e9faaf4bf9586f61a7b83d5cb5af501194 X-Git-Newrev: 527dd1b407e7d74037a19aed6e25aa36578da2f7 Message-Id: <20230324115141.C943E3858D28@sourceware.org> Date: Fri, 24 Mar 2023 11:51:41 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3D527dd1b407e= 7d74037a19aed6e25aa36578da2f7 commit 527dd1b407e7d74037a19aed6e25aa36578da2f7 Author: Yoshinao Muramatsu AuthorDate: Mon Mar 20 20:51:00 2023 +0900 Commit: Corinna Vinschen CommitDate: Tue Mar 21 18:56:27 2023 +0100 Cygwin: fix unlink in container =20 Deleting files returns STATUS_INVALID_PARAMETE on a bind mounted file s= ystem in hyper-v container with FILE_DISPOSITION_POSIX_SEMANTICS. Therefore fall back to default method. =20 This code is suggested by Johannes Schindelin on github and I change it more simple. =20 Signed-off-by: Yoshinao Muramatsu Diff: --- winsup/cygwin/syscalls.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc index 3e2d42f3aa8b..4e278808a02b 100644 --- a/winsup/cygwin/syscalls.cc +++ b/winsup/cygwin/syscalls.cc @@ -733,7 +733,10 @@ unlink_nt (path_conv &pc, bool shareable) /* Trying to delete in-use executables and DLLs using FILE_DISPOSITION_POSIX_SEMANTICS returns STATUS_CANNOT_DELETE. Fall back to the default method. */ - if (status !=3D STATUS_CANNOT_DELETE) + /* Additionaly that returns STATUS_INVALID_PARAMETER + on a bind mounted fs in hyper-v container. Falling back too. */ + if (status !=3D STATUS_CANNOT_DELETE + && status !=3D STATUS_INVALID_PARAMETER) goto out; }