]> git.saurik.com Git - apple/libc.git/blob - stdlib/FreeBSD/exit.c.patch
7afb64066e5f20bd6bcc6edccbbf7d420dafea1d
[apple/libc.git] / stdlib / FreeBSD / exit.c.patch
1 --- exit.c.bsdnew 2009-11-13 14:11:48.000000000 -0800
2 +++ exit.c 2009-11-13 14:47:07.000000000 -0800
3 @@ -42,15 +42,7 @@ __FBSDID("$FreeBSD: src/lib/libc/stdlib/
4 #include "libc_private.h"
5
6 void (*__cleanup)(void);
7 -
8 -/*
9 - * This variable is zero until a process has created a thread.
10 - * It is used to avoid calling locking functions in libc when they
11 - * are not required. By default, libc is intended to be(come)
12 - * thread-safe, but without a (significant) penalty to non-threaded
13 - * processes.
14 - */
15 -int __isthreaded = 0;
16 +extern void __exit(int);
17
18 /*
19 * Exit, flushing stdio buffers if necessary.
20 @@ -59,13 +51,8 @@ void
21 exit(status)
22 int status;
23 {
24 - /* Ensure that the auto-initialization routine is linked in: */
25 - extern int _thread_autoinit_dummy_decl;
26 -
27 - _thread_autoinit_dummy_decl = 1;
28 -
29 __cxa_finalize(NULL);
30 if (__cleanup)
31 (*__cleanup)();
32 - _exit(status);
33 + __exit(status);
34 }