summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/syscalls.cc
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2009-07-17 16:45:22 +0000
committerCorinna Vinschen <corinna@vinschen.de>2009-07-17 16:45:22 +0000
commit8319377680efac1de4ee3c1dee37c1494042304b (patch)
tree4ccf85d635c41c84dc0c9e1822f9367c565c9140 /winsup/cygwin/syscalls.cc
parent0bf9a206448cf81d53d4b16744a928967f6c457f (diff)
downloadcygnal-8319377680efac1de4ee3c1dee37c1494042304b.tar.gz
cygnal-8319377680efac1de4ee3c1dee37c1494042304b.tar.bz2
cygnal-8319377680efac1de4ee3c1dee37c1494042304b.zip
* syscalls.cc (unlink_nt): Just return when a sharing violation
occurs on remote filesystems.
Diffstat (limited to 'winsup/cygwin/syscalls.cc')
-rw-r--r--winsup/cygwin/syscalls.cc14
1 files changed, 13 insertions, 1 deletions
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 ())