From 6a4878cf1617f051e4706ce30f7c8607ebf2e85d Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Mon, 29 Jan 2001 00:46:25 +0000 Subject: * syscalls.cc (_link): Make sure that newpath does not exist. Set errno if it does. * cygheap.cc (init_cheap): Don't specify a load address for the heap. It doesn't work on #!*& Windows 9x. (cygheap_init): Move GetUserName to memory_init. * dcrt0.cc (dll_crt0_1): Call new memory_init functin, eliminate call to heap_init. * heap.cc (heap_init): Improve error output. * heap.h: Correct some declarations. * shared.cc (mount_table_init): Remove. (memory_init): Renamed from shared_init. Reorganize to accomodate strange Windows 9x problems with cygheap/heap interaction. * shared_info.h: Rename shared_init to memory_init. --- winsup/cygwin/syscalls.cc | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'winsup/cygwin/syscalls.cc') diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc index 3945912f3..c7d70fdbc 100644 --- a/winsup/cygwin/syscalls.cc +++ b/winsup/cygwin/syscalls.cc @@ -531,6 +531,13 @@ _link (const char *a, const char *b) set_errno (real_b.error); goto done; } + + if (real_b.file_attributes () != (DWORD)-1) + { + syscall_printf ("file '%s' exists?", (char *)real_b); + set_errno (EEXIST); + goto done; + } if (real_b.get_win32 ()[strlen (real_b.get_win32 ()) - 1] == '.') { syscall_printf ("trailing dot, bailing out"); -- cgit v1.2.3