aboutsummaryrefslogtreecommitdiff
path: root/winsup/cygwin/syscalls.cc
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2006-12-07 17:53:05 +0000
committerCorinna Vinschen <corinna@vinschen.de>2006-12-07 17:53:05 +0000
commite563a4d5b812b3691caf7e9bdbd40b66213c5545 (patch)
treef945a52b109892e4c53db8d9e8bfeb8ae46d8f55 /winsup/cygwin/syscalls.cc
parent1c9b2968fa28635d23d1a855ea9dcd15967cbe44 (diff)
downloadnewlib-e563a4d5b812b3691caf7e9bdbd40b66213c5545.zip
newlib-e563a4d5b812b3691caf7e9bdbd40b66213c5545.tar.gz
newlib-e563a4d5b812b3691caf7e9bdbd40b66213c5545.tar.bz2
* syscalls.cc (unlink_nt): Open native symlinks with
FILE_OPEN_REPARSE_POINT flag.
Diffstat (limited to 'winsup/cygwin/syscalls.cc')
-rw-r--r--winsup/cygwin/syscalls.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc
index 1e23323..928e1c6 100644
--- a/winsup/cygwin/syscalls.cc
+++ b/winsup/cygwin/syscalls.cc
@@ -207,6 +207,10 @@ unlink_nt (path_conv &win32_name, bool setattrs)
2K3 and in all cases, DeleteFile works, "delete on close" does not. */
if (!win32_name.isremote ())
flags |= FILE_DELETE_ON_CLOSE;
+ /* Add the reparse point flag to native symlinks, otherwise we remove the
+ target, not the symlink. */
+ if (win32_name.is_rep_symlink ())
+ flags |= FILE_OPEN_REPARSE_POINT;
win32_name.get_nt_native_path (upath);
InitializeObjectAttributes (&attr, &upath, OBJ_CASE_INSENSITIVE | OBJ_INHERIT,