diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2007-01-31 10:55:59 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2007-01-31 10:55:59 +0000 |
commit | c3772e717fc3b37fe5db2eac76c4ab907f9f033f (patch) | |
tree | 2f2f6c4179c97111376f48bb725642c9461c96e0 /winsup/cygwin | |
parent | ff2a198b68328fc2586d84235e0617a533c0f69f (diff) | |
download | cygnal-c3772e717fc3b37fe5db2eac76c4ab907f9f033f.tar.gz cygnal-c3772e717fc3b37fe5db2eac76c4ab907f9f033f.tar.bz2 cygnal-c3772e717fc3b37fe5db2eac76c4ab907f9f033f.zip |
* fhandler_disk_file.cc (fhandler_disk_file::closedir): Add dir name
to debug output.
* syscalls.cc (try_to_bin): Enable code to move file to user specific
recycler dir to eliminate Vista problem.
(unlink_nt): Add comment that rename after opening for delete on close
only fails on XP.
Diffstat (limited to 'winsup/cygwin')
-rw-r--r-- | winsup/cygwin/ChangeLog | 9 | ||||
-rw-r--r-- | winsup/cygwin/fhandler_disk_file.cc | 2 | ||||
-rw-r--r-- | winsup/cygwin/syscalls.cc | 19 |
3 files changed, 21 insertions, 9 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index e6e2131cb..ba4a9ff99 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,5 +1,14 @@ 2007-01-30 Corinna Vinschen <corinna@vinschen.de> + * fhandler_disk_file.cc (fhandler_disk_file::closedir): Add dir name + to debug output. + * syscalls.cc (try_to_bin): Enable code to move file to user specific + recycler dir to eliminate Vista problem. + (unlink_nt): Add comment that rename after opening for delete on close + only fails on XP. + +2007-01-30 Corinna Vinschen <corinna@vinschen.de> + * sigproc.cc (child_info::child_info): Set msv_count to non-zero value only on systems requiring it. diff --git a/winsup/cygwin/fhandler_disk_file.cc b/winsup/cygwin/fhandler_disk_file.cc index 7de7e56ba..646645094 100644 --- a/winsup/cygwin/fhandler_disk_file.cc +++ b/winsup/cygwin/fhandler_disk_file.cc @@ -2046,7 +2046,7 @@ fhandler_disk_file::closedir (DIR *dir) res = -1; } } - syscall_printf ("%d = closedir (%p)", res, dir); + syscall_printf ("%d = closedir (%p, %s)", res, dir, get_name ()); return res; } diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc index 8aec2e649..6cc89f9ae 100644 --- a/winsup/cygwin/syscalls.cc +++ b/winsup/cygwin/syscalls.cc @@ -180,12 +180,13 @@ try_to_bin (path_conv &win32_path, HANDLE h) FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN); } -#if 0 - /* The default settings for the top level recycle bin are so that - everybody has the right to create files in it. Should that be - insufficient at one point, we can enable the following code to - move the file into the user's own bin subdir. At this point, - I'm going to opt for speed, though. */ + /* Up to Windows 2003 Server, the default settings for the top level recycle + bin are so that everybody has the right to create files in it. Starting + with Vista, users are by default not allowed to create files in that + directory, only subdirectories. Too bad, but that requires to move + files to the user's own recycler subdir. Instead of adding yet another + special case, we just move the stuff to the user's recycler, especially + since only shared files are moved at all. */ if (win32_path.fs_is_ntfs ()) { *c++ = '\\'; @@ -205,7 +206,6 @@ try_to_bin (path_conv &win32_path, HANDLE h) FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN); } } -#endif /* Create hopefully unique filename. */ __small_sprintf (c, "\\cyg%016X", hash_path_name (myself->uid, @@ -253,7 +253,10 @@ unlink_nt (path_conv &win32_name, bool setattrs) is opened "delete on close", the rename operation in try_to_bin fails with STATUS_ACCESS_DENIED. So directories must be deleted using NtSetInformationFile, class FileDispositionInformation, which works fine. - + + Correction, moving a directory opened with delete-on-close fails ONLY + on XP. Note to myself: Never take anything for granted on Windows! + Don't try "delete on close" if the file is on a remote share. If two processes have open handles on a file and one of them calls unlink, then it happens that the file is removed from the remote share even though the |