aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2006-03-08 23:55:14 +0000
committerChristopher Faylor <me@cgf.cx>2006-03-08 23:55:14 +0000
commit9aca6a48a57bca1a59a236cf6dd20c4da5f78fb2 (patch)
tree01d21a27df25f46260042121d190a6c38ab07e85
parent6ca53189400aa2d4b12ccea4378f5b2ff759cf50 (diff)
downloadnewlib-9aca6a48a57bca1a59a236cf6dd20c4da5f78fb2.zip
newlib-9aca6a48a57bca1a59a236cf6dd20c4da5f78fb2.tar.gz
newlib-9aca6a48a57bca1a59a236cf6dd20c4da5f78fb2.tar.bz2
* cygtls.h (_cygtls::retaddr): New method.
* dll_init.cc (cygwin_detach_dll): Use new tls function to find return address since this function is now signal guarded. (update_envptrs): Remove unneeded braces. * syscalls.cc (statvfs): Coerce full_path to avoid a gcc warning.
-rw-r--r--winsup/cygwin/ChangeLog8
-rw-r--r--winsup/cygwin/cygtls.h1
-rw-r--r--winsup/cygwin/dll_init.cc9
-rw-r--r--winsup/cygwin/syscalls.cc4
4 files changed, 15 insertions, 7 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 93fd839..9f1c1f1 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,11 @@
+2006-03-08 Christopher Faylor <cgf@timesys.com>
+
+ * cygtls.h (_cygtls::retaddr): New method.
+ * dll_init.cc (cygwin_detach_dll): Use new tls method to find return
+ address since this function is now signal guarded.
+ (update_envptrs): Remove unneeded braces.
+ * syscalls.cc (statvfs): Coerce full_path to avoid a gcc warning.
+
2006-03-08 Corinna Vinschen <corinna@vinschen.de>
* syscalls.cc (statvfs): Simplify path name expression.
diff --git a/winsup/cygwin/cygtls.h b/winsup/cygwin/cygtls.h
index 609eb96..5e3155a 100644
--- a/winsup/cygwin/cygtls.h
+++ b/winsup/cygwin/cygtls.h
@@ -183,6 +183,7 @@ struct _cygtls
void remove (DWORD);
void push (__stack_t) __attribute__ ((regparm (2)));
__stack_t pop () __attribute__ ((regparm (1)));
+ __stack_t retaddr () {return stackptr[-1];}
bool isinitialized () const {return initialized == CYGTLS_INITIALIZED;}
bool interrupt_now (CONTEXT *, int, void *, struct sigaction&)
__attribute__((regparm(3)));
diff --git a/winsup/cygwin/dll_init.cc b/winsup/cygwin/dll_init.cc
index ecfc976..7d35c16 100644
--- a/winsup/cygwin/dll_init.cc
+++ b/winsup/cygwin/dll_init.cc
@@ -1,6 +1,6 @@
/* dll_init.cc
- Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.
+ Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Red Hat, Inc.
This software is a copyrighted work licensed under the terms of the
Cygwin license. Please consult the file "CYGWIN_LICENSE" for
@@ -18,6 +18,7 @@ details. */
#include "dtable.h"
#include "cygheap.h"
#include "pinfo.h"
+#include "cygtls.h"
extern void __stdcall check_sanity_and_sync (per_process *);
@@ -403,7 +404,7 @@ dll_noncygwin_dllcrt0 (HMODULE h, per_process *p)
extern "C" void
cygwin_detach_dll (dll *)
{
- dlls.detach (__builtin_return_address (0));
+ dlls.detach ((HANDLE) _my_tls.retaddr ());
}
extern "C" void
@@ -420,8 +421,6 @@ update_envptrs ()
{
extern char ***main_environ;
for (dll *d = dlls.istart (DLL_ANY); d; d = dlls.inext ())
- {
- *(d->p.envptr) = __cygwin_environ;
- }
+ *(d->p.envptr) = __cygwin_environ;
*main_environ = __cygwin_environ;
}
diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc
index ef3f90f..5cb5fe7 100644
--- a/winsup/cygwin/syscalls.cc
+++ b/winsup/cygwin/syscalls.cc
@@ -1850,14 +1850,14 @@ statvfs (const char *fname, struct statvfs *sfs)
OPEN_EXISTING,
FILE_FLAG_BACKUP_SEMANTICS, NULL);
if (hdl == INVALID_HANDLE_VALUE)
- debug_printf ("CreateFile (%s) failed, %E", full_path);
+ debug_printf ("CreateFile (%s) failed, %E", (char *) full_path);
else
{
NTFS_VOLUME_DATA_BUFFER nvdb;
DWORD bytes;
if (!DeviceIoControl (hdl, FSCTL_GET_NTFS_VOLUME_DATA, NULL,
0, &nvdb, sizeof nvdb, &bytes, NULL))
- debug_printf ("DeviceIoControl (%s) failed, %E", full_path);
+ debug_printf ("DeviceIoControl (%s) failed, %E", (char *) full_path);
else
totalc = nvdb.TotalClusters.QuadPart;
CloseHandle (hdl);