diff options
-rw-r--r-- | winsup/cygwin/ChangeLog | 5 | ||||
-rw-r--r-- | winsup/cygwin/syscalls.cc | 14 |
2 files changed, 18 insertions, 1 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 7f4abc994..71dbae4ed 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,5 +1,10 @@ 2009-07-17 Corinna Vinschen <corinna@vinschen.de> + * syscalls.cc (unlink_nt): Just return when a sharing violation + occurs on remote filesystems. + +2009-07-17 Corinna Vinschen <corinna@vinschen.de> + * globals.cc: Improve comment on R/O UNICODE_STRINGs. * mount.h (class fs_info): Add is_mvfs bit. * mount.cc (fs_info::update): Recognize MVFS remote filesystem. 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 ()) |