Blame patches/bash-5.1.8.local.patch

f902ce
diff -ru bash-5.1.orig/configure bash-5.1/configure
f902ce
--- bash-5.1.orig/configure	2020-12-04 15:05:14.000000000 +0100
f902ce
+++ bash-5.1/configure	2020-12-08 14:34:05.162114735 +0100
f902ce
@@ -2917,6 +2917,7 @@
f902ce
 *-nsk*)		opt_bash_malloc=no ;;	# HP NonStop
f902ce
 *-haiku*)	opt_bash_malloc=no ;;	# Haiku OS
f902ce
 *-genode*)	opt_bash_malloc=no ;;	# Genode has no sbrk
f902ce
+*-midipix*)	opt_bash_malloc=no ;;	# Midipix
f902ce
 esac
f902ce
 
f902ce
 # memory scrambling on free()
f902ce
diff -ru bash-5.1.orig/lib/sh/oslib.c bash-5.1/lib/sh/oslib.c
f902ce
--- bash-5.1.orig/lib/sh/oslib.c	2013-10-14 15:12:57.000000000 +0200
f902ce
+++ bash-5.1/lib/sh/oslib.c	2020-12-08 14:35:05.062112859 +0100
f902ce
@@ -280,7 +280,7 @@
f902ce
 long
f902ce
 getmaxchild ()
f902ce
 {
f902ce
-  static long maxchild = -1L;
f902ce
+  static long maxchild = _SC_CHILD_MAX;
f902ce
 
f902ce
   if (maxchild > 0)
f902ce
     return maxchild;
Lucio Andrés Illanes Albornoz 871c96
--- bash-5.1.8/builtins/psize.sh.orig	2013-10-14 15:14:35.000000000 +0200
Lucio Andrés Illanes Albornoz 871c96
+++ bash-5.1.8/builtins/psize.sh	2021-08-19 09:16:16.724336836 +0200
Lucio Andrés Illanes Albornoz 871c96
@@ -1,21 +1,6 @@
Lucio Andrés Illanes Albornoz 871c96
 #! /bin/sh
Lucio Andrés Illanes Albornoz 871c96
 #
Lucio Andrés Illanes Albornoz 871c96
-# psize.sh -- determine this system's pipe size, and write a define to
Lucio Andrés Illanes Albornoz 871c96
-#             pipesize.h so ulimit.c can use it.
Lucio Andrés Illanes Albornoz 871c96
-
Lucio Andrés Illanes Albornoz 871c96
-: ${TMPDIR:=/tmp}
Lucio Andrés Illanes Albornoz 871c96
-# try to use mktemp(1) if the system supports it
Lucio Andrés Illanes Albornoz 871c96
-{ TMPFILE="`mktemp $TMPDIR/pipsize.XXXXXX 2>/dev/null`"; } 2>/dev/null
Lucio Andrés Illanes Albornoz 871c96
-used_mktemp=true
Lucio Andrés Illanes Albornoz 871c96
-
Lucio Andrés Illanes Albornoz 871c96
-if [ -z "$TMPFILE" ]; then
Lucio Andrés Illanes Albornoz 871c96
-	TMPNAME=pipsize.$$
Lucio Andrés Illanes Albornoz 871c96
-	TMPFILE=$TMPDIR/$TMPNAME
Lucio Andrés Illanes Albornoz 871c96
-	used_mktemp=false
Lucio Andrés Illanes Albornoz 871c96
-fi
Lucio Andrés Illanes Albornoz 871c96
-
Lucio Andrés Illanes Albornoz 871c96
-trap 'rm -f "$TMPFILE" ; exit 1' 1 2 3 6 15
Lucio Andrés Illanes Albornoz 871c96
-trap 'rm -f "$TMPFILE"' 0
Lucio Andrés Illanes Albornoz 871c96
+# psize.sh -- write midipix' pipe size define to pipesize.h so ulimit.c can use it.
Lucio Andrés Illanes Albornoz 871c96
 
Lucio Andrés Illanes Albornoz 871c96
 echo "/*"
Lucio Andrés Illanes Albornoz 871c96
 echo " * pipesize.h"
Lucio Andrés Illanes Albornoz 871c96
@@ -24,22 +9,6 @@
Lucio Andrés Illanes Albornoz 871c96
 echo " * Do not edit!"
Lucio Andrés Illanes Albornoz 871c96
 echo " */"
Lucio Andrés Illanes Albornoz 871c96
 echo ""
Lucio Andrés Illanes Albornoz 871c96
-
Lucio Andrés Illanes Albornoz 871c96
-#
Lucio Andrés Illanes Albornoz 871c96
-# Try to avoid tempfile races.  We can't really check for the file's
Lucio Andrés Illanes Albornoz 871c96
-# existence before we run psize.aux, because `test -e' is not portable,
Lucio Andrés Illanes Albornoz 871c96
-# `test -h' (test for symlinks) is not portable, and `test -f' only
Lucio Andrés Illanes Albornoz 871c96
-# checks for regular files.  If we used mktemp(1), we're ahead of the
Lucio Andrés Illanes Albornoz 871c96
-# game.
Lucio Andrés Illanes Albornoz 871c96
-#
Lucio Andrés Illanes Albornoz 871c96
-$used_mktemp || rm -f "$TMPFILE"
Lucio Andrés Illanes Albornoz 871c96
-
Lucio Andrés Illanes Albornoz 871c96
-./psize.aux 2>"$TMPFILE" | sleep 3
Lucio Andrés Illanes Albornoz 871c96
-
Lucio Andrés Illanes Albornoz 871c96
-if [ -s "$TMPFILE" ]; then
Lucio Andrés Illanes Albornoz 871c96
-	echo "#define PIPESIZE `cat "$TMPFILE"`"
Lucio Andrés Illanes Albornoz 871c96
-else
Lucio Andrés Illanes Albornoz 871c96
-	echo "#define PIPESIZE 512"
Lucio Andrés Illanes Albornoz 871c96
-fi
Lucio Andrés Illanes Albornoz 871c96
+echo "#define PIPESIZE 512"
Lucio Andrés Illanes Albornoz 871c96
 
Lucio Andrés Illanes Albornoz 871c96
 exit 0