aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-01-28 06:46:50 +0000
committerUlrich Drepper <drepper@redhat.com>2003-01-28 06:46:50 +0000
commit1fc469088e3c80f03d37b2e6464280799aec0041 (patch)
treeaf233516715d805be036364119899ef3113daf6a
parent68ff8426c6b8cf5dd93f2dd151ab21cb83fa990b (diff)
downloadglibc-1fc469088e3c80f03d37b2e6464280799aec0041.tar
glibc-1fc469088e3c80f03d37b2e6464280799aec0041.tar.gz
glibc-1fc469088e3c80f03d37b2e6464280799aec0041.tar.bz2
glibc-1fc469088e3c80f03d37b2e6464280799aec0041.zip
Update.
* stdio-common/vfprintf.c [USE_IN_LIBIO]: Use _IO_cleanup_region_start instead of __libc_cleanup_region_start and _IO_cleanup_region_end instead of __libc_cleanup_region_end. * sysdeps/unix/sysv/linux/i386/system.c (CLEANUP_HANDLER): Pass 1 as first parameter to __libc_cleanup_region_start.
-rw-r--r--ChangeLog7
-rw-r--r--nptl/sysdeps/pthread/bits/libc-lock.h17
-rw-r--r--stdio-common/vfprintf.c7
-rw-r--r--sysdeps/unix/sysv/linux/i386/system.c2
4 files changed, 23 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index db6bcdb922..021601f2f1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2003-01-27 Ulrich Drepper <drepper@redhat.com>
+ * stdio-common/vfprintf.c [USE_IN_LIBIO]: Use _IO_cleanup_region_start
+ instead of __libc_cleanup_region_start and _IO_cleanup_region_end
+ instead of __libc_cleanup_region_end.
+
+ * sysdeps/unix/sysv/linux/i386/system.c (CLEANUP_HANDLER): Pass 1
+ as first parameter to __libc_cleanup_region_start.
+
* sysdeps/unix/sysv/linux/powerpc/powerpc64/fe_nomask.c
(__fe_nomask_env): Use __prctl not prctl.
* sysdeps/unix/sysv/linux/syscalls.list: Add __prctl alias for
diff --git a/nptl/sysdeps/pthread/bits/libc-lock.h b/nptl/sysdeps/pthread/bits/libc-lock.h
index e4b5b802ee..f19281e999 100644
--- a/nptl/sysdeps/pthread/bits/libc-lock.h
+++ b/nptl/sysdeps/pthread/bits/libc-lock.h
@@ -348,12 +348,17 @@ typedef pthread_key_t __libc_key_t;
/* Start critical region with cleanup. */
#define __libc_cleanup_region_start(DOIT, FCT, ARG) \
{ struct _pthread_cleanup_buffer _buffer; \
- int _avail = PTF(_pthread_cleanup_push_defer) != NULL; \
- if (_avail) { \
- PTF(_pthread_cleanup_push_defer) (&_buffer, FCT, ARG); \
- } else if (DOIT) { \
- _buffer.__routine = (FCT); \
- _buffer.__arg = (ARG); \
+ int _avail; \
+ if (DOIT) { \
+ _avail = PTF(_pthread_cleanup_push_defer) != NULL; \
+ if (_avail) { \
+ PTF(_pthread_cleanup_push_defer) (&_buffer, FCT, ARG); \
+ } else { \
+ _buffer.__routine = (FCT); \
+ _buffer.__arg = (ARG); \
+ } \
+ } else { \
+ _avail = 0; \
}
/* End critical region with cleanup. */
diff --git a/stdio-common/vfprintf.c b/stdio-common/vfprintf.c
index a5902164ee..26277e2b22 100644
--- a/stdio-common/vfprintf.c
+++ b/stdio-common/vfprintf.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2002, 2003 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -1307,7 +1307,7 @@ vfprintf (FILE *s, const CHAR_T *format, va_list ap)
/* Lock stream. */
#ifdef USE_IN_LIBIO
- __libc_cleanup_region_start (1, (void (*) (void *)) &_IO_funlockfile, s);
+ _IO_cleanup_region_start ((void (*) (void *)) &_IO_funlockfile, s);
_IO_flockfile (s);
#else
__libc_cleanup_region_start (1, (void (*) (void *)) &__funlockfile, s);
@@ -1909,10 +1909,11 @@ all_done:
/* Unlock the stream. */
#ifdef USE_IN_LIBIO
_IO_funlockfile (s);
+ _IO_cleanup_region_end (0);
#else
__funlockfile (s);
-#endif
__libc_cleanup_region_end (0);
+#endif
return done;
}
diff --git a/sysdeps/unix/sysv/linux/i386/system.c b/sysdeps/unix/sysv/linux/i386/system.c
index a171541790..1e3035d7f3 100644
--- a/sysdeps/unix/sysv/linux/i386/system.c
+++ b/sysdeps/unix/sysv/linux/i386/system.c
@@ -40,7 +40,7 @@
static void cancel_handler (void *arg);
#define CLEANUP_HANDLER \
- __libc_cleanup_region_start (0, cancel_handler, &pid)
+ __libc_cleanup_region_start (1, cancel_handler, &pid)
#define CLEANUP_RESET \
__libc_cleanup_region_end (0)