Deleted Added
full compact
exit.c (92986) exit.c (123674)
1/*-
2 * Copyright (c) 1990, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 21 unchanged lines hidden (view full) ---

30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 */
33
34#if defined(LIBC_SCCS) && !defined(lint)
35static char sccsid[] = "@(#)exit.c 8.1 (Berkeley) 6/4/93";
36#endif /* LIBC_SCCS and not lint */
37#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1990, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 21 unchanged lines hidden (view full) ---

30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 */
33
34#if defined(LIBC_SCCS) && !defined(lint)
35static char sccsid[] = "@(#)exit.c 8.1 (Berkeley) 6/4/93";
36#endif /* LIBC_SCCS and not lint */
37#include <sys/cdefs.h>
38__FBSDID("$FreeBSD: head/lib/libc/stdlib/exit.c 92986 2002-03-22 21:53:29Z obrien $");
38__FBSDID("$FreeBSD: head/lib/libc/stdlib/exit.c 123674 2003-12-19 17:11:21Z kan $");
39
40#include "namespace.h"
41#include <stdlib.h>
42#include <unistd.h>
43#include "un-namespace.h"
44#include "atexit.h"
45
46void (*__cleanup)();

--- 9 unchanged lines hidden (view full) ---

56
57/*
58 * Exit, flushing stdio buffers if necessary.
59 */
60void
61exit(status)
62 int status;
63{
39
40#include "namespace.h"
41#include <stdlib.h>
42#include <unistd.h>
43#include "un-namespace.h"
44#include "atexit.h"
45
46void (*__cleanup)();

--- 9 unchanged lines hidden (view full) ---

56
57/*
58 * Exit, flushing stdio buffers if necessary.
59 */
60void
61exit(status)
62 int status;
63{
64 struct atexit *p;
65 int n;
66
67 /* Ensure that the auto-initialization routine is linked in: */
68 extern int _thread_autoinit_dummy_decl;
69
70 _thread_autoinit_dummy_decl = 1;
71
64 /* Ensure that the auto-initialization routine is linked in: */
65 extern int _thread_autoinit_dummy_decl;
66
67 _thread_autoinit_dummy_decl = 1;
68
72 for (p = __atexit; p; p = p->next)
73 for (n = p->ind; --n >= 0;)
74 (*p->fns[n])();
69 __cxa_finalize(NULL);
75 if (__cleanup)
76 (*__cleanup)();
77 _exit(status);
78}
70 if (__cleanup)
71 (*__cleanup)();
72 _exit(status);
73}