diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2007-08-02 15:13:56 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2007-08-02 15:13:56 +0000 |
commit | e809fec984b4d7a7c972d4963fba03301b46be2b (patch) | |
tree | 23d9572ebe54d0d11ab420ebac7f752954af334f /winsup/cygwin/syscalls.cc | |
parent | 64a62f4cfe52666c015d19c747978f67def4cea4 (diff) | |
download | cygnal-e809fec984b4d7a7c972d4963fba03301b46be2b.tar.gz cygnal-e809fec984b4d7a7c972d4963fba03301b46be2b.tar.bz2 cygnal-e809fec984b4d7a7c972d4963fba03301b46be2b.zip |
* fhandler_disk_file.cc (readdir_get_ino): Accommodate native symlinks.
* syscalls.cc (rename): Ditto.
Diffstat (limited to 'winsup/cygwin/syscalls.cc')
-rw-r--r-- | winsup/cygwin/syscalls.cc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc index 03e041348..4d6f94951 100644 --- a/winsup/cygwin/syscalls.cc +++ b/winsup/cygwin/syscalls.cc @@ -1516,7 +1516,9 @@ rename (const char *oldpath, const char *newpath) /* DELETE is required to rename a file. */ status = NtOpenFile (&fh, DELETE, oldpc.get_object_attr (attr, sec_none_nih), - &io, FILE_SHARE_VALID_FLAGS, FILE_OPEN_FOR_BACKUP_INTENT); + &io, FILE_SHARE_VALID_FLAGS, + FILE_OPEN_FOR_BACKUP_INTENT + | (oldpc.is_rep_symlink () ? FILE_OPEN_REPARSE_POINT : 0)); if (!NT_SUCCESS (status)) { __seterrno_from_nt_status (status); @@ -1535,7 +1537,10 @@ rename (const char *oldpath, const char *newpath) && ofsi.NumberOfLinks > 1 && NT_SUCCESS (NtOpenFile (&nfh, READ_CONTROL, (removepc ?: dstpc)->get_object_attr (attr, sec_none_nih), - &io, FILE_SHARE_VALID_FLAGS, FILE_OPEN_FOR_BACKUP_INTENT))) + &io, FILE_SHARE_VALID_FLAGS, + FILE_OPEN_FOR_BACKUP_INTENT + | ((removepc ?: dstpc)->is_rep_symlink () + ? FILE_OPEN_REPARSE_POINT : 0)))) { static const size_t vsiz = sizeof (FILE_FS_VOLUME_INFORMATION) + 32 * sizeof (WCHAR); |