summaryrefslogtreecommitdiffstats
path: root/main/make/fix-atexit-exit.patch
diff options
context:
space:
mode:
Diffstat (limited to 'main/make/fix-atexit-exit.patch')
-rw-r--r--main/make/fix-atexit-exit.patch16
1 files changed, 16 insertions, 0 deletions
diff --git a/main/make/fix-atexit-exit.patch b/main/make/fix-atexit-exit.patch
new file mode 100644
index 000000000..dd7cc25f7
--- /dev/null
+++ b/main/make/fix-atexit-exit.patch
@@ -0,0 +1,16 @@
+Author: Timo Teräs <timo.teras@iki.fi>
+
+POSIX says the behaviour is undefined if atexit callback calls
+exit(). On glibc it works, but on musl it does not. Call instead
+_exit() which is guaranteed to work.
+
+--- make-3.82.orig/misc.c
++++ make-3.82/misc.c
+@@ -954,6 +954,6 @@
+ error (NILF, _("write error: %s"), strerror (errno));
+ else
+ error (NILF, _("write error"));
+- exit (EXIT_FAILURE);
++ _exit (EXIT_FAILURE);
+ }
+ }