summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/cygtls.h
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2008-05-22 20:32:15 +0000
committerCorinna Vinschen <corinna@vinschen.de>2008-05-22 20:32:15 +0000
commitc15121a287a2dbb59fdfe6b22ca6866f94f77f0a (patch)
tree83a973bd62a1556ca9f302eca1c1c0da7559bfe2 /winsup/cygwin/cygtls.h
parent3ad8ec85469e01d3fc3e96479444c8094f70020a (diff)
downloadcygnal-c15121a287a2dbb59fdfe6b22ca6866f94f77f0a.tar.gz
cygnal-c15121a287a2dbb59fdfe6b22ca6866f94f77f0a.tar.bz2
cygnal-c15121a287a2dbb59fdfe6b22ca6866f94f77f0a.zip
* cygtls.h (struct san): Add two int values to store the current
tls_pathbuf counters. (return_from_fault): Restore tls_pathbuf counters. (setup_fault): Save tls_pathbuf counters. * tlsoffset.h: Regenerate.
Diffstat (limited to 'winsup/cygwin/cygtls.h')
-rw-r--r--winsup/cygwin/cygtls.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/winsup/cygwin/cygtls.h b/winsup/cygwin/cygtls.h
index 124bf4e6a..0c709b9bc 100644
--- a/winsup/cygwin/cygtls.h
+++ b/winsup/cygwin/cygtls.h
@@ -48,6 +48,7 @@ class tls_pathbuf
public:
void destroy ();
friend class tmp_pathbuf;
+ friend class _cygtls;
};
struct _local_storage
@@ -132,6 +133,8 @@ typedef struct
{
void *_myfault;
int _myfault_errno;
+ int _myfault_c_cnt;
+ int _myfault_w_cnt;
} san;
/* Changes to the below structure may require acompanying changes to the very
@@ -232,14 +235,22 @@ struct _cygtls
{
if (andreas._myfault_errno)
set_errno (andreas._myfault_errno);
+ /* Restore tls_pathbuf counters in case of error. */
+ locals.pathbufs.c_cnt = andreas._myfault_c_cnt;
+ locals.pathbufs.w_cnt = andreas._myfault_w_cnt;
__ljfault ((int *) andreas._myfault, 1);
}
int setup_fault (jmp_buf j, san& old_j, int myerrno) __attribute__ ((always_inline))
{
old_j._myfault = andreas._myfault;
old_j._myfault_errno = andreas._myfault_errno;
+ old_j._myfault_c_cnt = andreas._myfault_c_cnt;
+ old_j._myfault_w_cnt = andreas._myfault_w_cnt;
andreas._myfault = (void *) j;
andreas._myfault_errno = myerrno;
+ /* Save tls_pathbuf counters. */
+ andreas._myfault_c_cnt = locals.pathbufs.c_cnt;
+ andreas._myfault_w_cnt = locals.pathbufs.w_cnt;
return __sjfault (j);
}
void reset_fault (san& old_j) __attribute__ ((always_inline))