Browse Source

make: added an alpine patch to fix UB.

user/amery/next-tc
Nagy Károly Gábriel 8 years ago
committed by Alejandro Mery
parent
commit
ab8c1a48fe
1 changed files with 34 additions and 0 deletions
  1. +34
    -0
      base/make/fix-atexit-exit.patch

+ 34
- 0
base/make/fix-atexit-exit.patch

@ -0,0 +1,34 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: package/.../make/fix-atexit-exit.patch
# Copyright (C) 2016 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
# --- SDE-COPYRIGHT-NOTE-END ---
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);
}
}

Loading…
Cancel
Save