summaryrefslogblamecommitdiff
path: root/system/make/fix-atexit-exit.patch
blob: a71d26fb55e69363cb98649d68bd53c69890ec07 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17















                                                                
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.

--- ./output.c.orig
+++ ./output.c
@@ -495,7 +495,7 @@
         perror_with_name (_("write error: stdout"), "");
       else
         O (error, NILF, _("write error: stdout"));
-      exit (MAKE_TROUBLE);
+      _exit (MAKE_TROUBLE);
     }
 }