From 8319377680efac1de4ee3c1dee37c1494042304b Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Fri, 17 Jul 2009 16:45:22 +0000 Subject: * syscalls.cc (unlink_nt): Just return when a sharing violation occurs on remote filesystems. --- winsup/cygwin/syscalls.cc | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'winsup/cygwin/syscalls.cc') diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc index 14dd884b1..6f2de057a 100644 --- a/winsup/cygwin/syscalls.cc +++ b/winsup/cygwin/syscalls.cc @@ -497,7 +497,19 @@ unlink_nt (path_conv &pc) times out. Opening the file with FILE_SHARE_VALID_FLAGS will work, though, and it is then possible to delete the file quite normally. */ - /* Bin is only accessible locally. */ + /* The recycle bin is only accessible locally. For in-use remote + files we drop back to just returning EBUSY. */ + if (pc.isremote () && status == STATUS_SHARING_VIOLATION) + { + if (fh_ro) + { + /* Try to reset R/O attribute and close handle. */ + NtSetAttributesFile (fh_ro, pc.file_attributes ()); + NtClose (fh_ro); + } + return status; + } + /* Only local FS and NFS w/ STATUS_LOCK_NOT_GRANTED should arrive here. */ if (!pc.isremote ()) bin_stat = move_to_bin; if (!pc.isdir () || pc.isremote ()) -- cgit v1.2.3