summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/env/__init_security.c2
-rw-r--r--src/exit/exit.c6
2 files changed, 5 insertions, 3 deletions
diff --git a/src/env/__init_security.c b/src/env/__init_security.c
index 8270f1f4..395abeb5 100644
--- a/src/env/__init_security.c
+++ b/src/env/__init_security.c
@@ -8,7 +8,7 @@
#define AUX_CNT 24
-void dummy(size_t *auxv)
+static void dummy(size_t *auxv)
{
}
weak_alias(dummy, __init_ssp);
diff --git a/src/exit/exit.c b/src/exit/exit.c
index ae557c09..fc291484 100644
--- a/src/exit/exit.c
+++ b/src/exit/exit.c
@@ -2,6 +2,8 @@
#include <unistd.h>
#include <stdio.h>
#include "libc.h"
+#include "atomic.h"
+#include "syscall.h"
static void dummy()
{
@@ -13,10 +15,10 @@ weak_alias(dummy, __fflush_on_exit);
void exit(int code)
{
- static int lock[2];
+ static int lock;
/* If more than one thread calls exit, hang until _Exit ends it all */
- LOCK(lock);
+ while (a_swap(&lock, 1)) __syscall(SYS_pause);
/* Only do atexit & stdio flush if they were actually used */
__funcs_on_exit();