Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2010-08-18 19:21:35 +0400
committerCorinna Vinschen <corinna@vinschen.de>2010-08-18 19:21:35 +0400
commitce9898da68856fa1fdadc48f8d9d09536180a4c4 (patch)
tree1f444b1d57d7f781752c78ddf4c202603deadf12 /winsup/cygwin
parent75a3b85877941516c8430603f876019b916a6240 (diff)
* syscalls.cc (rename): Fix renaming file-based devices.
Diffstat (limited to 'winsup/cygwin')
-rw-r--r--winsup/cygwin/ChangeLog4
-rw-r--r--winsup/cygwin/syscalls.cc11
2 files changed, 10 insertions, 5 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index c4284bdac..5bca572b7 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,5 +1,9 @@
2010-08-18 Corinna Vinschen <corinna@vinschen.de>
+ * syscalls.cc (rename): Fix renaming file-based devices.
+
+2010-08-18 Corinna Vinschen <corinna@vinschen.de>
+
* exceptions.cc (open_stackdumpfile): Don't try to open file if we
have no filesystem based CWD. Add comment.
* path.cc (cwdstuff::set): Set CWD handle to NULL if CWD is a virtual
diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc
index ac1fea0d2..aaa4673a1 100644
--- a/winsup/cygwin/syscalls.cc
+++ b/winsup/cygwin/syscalls.cc
@@ -1804,8 +1804,9 @@ rename (const char *oldpath, const char *newpath)
set_errno (ENOENT);
goto out;
}
- if (oldpc.isspecial () && !oldpc.issocket ()) /* No renames from virtual FS */
+ if (oldpc.isspecial () && !oldpc.issocket () && !oldpc.is_fs_special ())
{
+ /* No renames from virtual FS */
set_errno (EROFS);
goto out;
}
@@ -1930,7 +1931,7 @@ rename (const char *oldpath, const char *newpath)
goto out;
}
}
- else if (oldpc.is_lnk_symlink ()
+ else if (oldpc.is_lnk_special ()
&& !RtlEqualUnicodePathSuffix (newpc.get_nt_native_path (),
&ro_u_lnk, TRUE))
rename_append_suffix (newpc, newpath, nlen, ".lnk");
@@ -1958,9 +1959,9 @@ rename (const char *oldpath, const char *newpath)
goto out;
}
}
- else if (oldpc.is_lnk_symlink ())
+ else if (oldpc.is_lnk_special ())
{
- if (!newpc.is_lnk_symlink ()
+ if (!newpc.is_lnk_special ()
&& !RtlEqualUnicodePathSuffix (newpc.get_nt_native_path (),
&ro_u_lnk, TRUE))
{
@@ -1992,7 +1993,7 @@ rename (const char *oldpath, const char *newpath)
{
new2pc.check (newpath, PC_SYM_NOFOLLOW, stat_suffixes);
newpc.get_nt_native_path ()->Length -= 4 * sizeof (WCHAR);
- if (new2pc.is_binary () || new2pc.is_lnk_symlink ())
+ if (new2pc.is_binary () || new2pc.is_lnk_special ())
removepc = &new2pc;
}
}