summaryrefslogtreecommitdiffhomepage
path: root/patches/bash-5.1.16.local.patch
blob: 677e7d9cc49f8d6062a18280a4f9237f6b98c771 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
diff -ru bash-5.1.orig/configure bash-5.1/configure
--- bash-5.1.orig/configure	2020-12-04 15:05:14.000000000 +0100
+++ bash-5.1/configure	2020-12-08 14:34:05.162114735 +0100
@@ -2917,6 +2917,7 @@
 *-nsk*)		opt_bash_malloc=no ;;	# HP NonStop
 *-haiku*)	opt_bash_malloc=no ;;	# Haiku OS
 *-genode*)	opt_bash_malloc=no ;;	# Genode has no sbrk
+*-midipix*)	opt_bash_malloc=no ;;	# Midipix
 esac
 
 # memory scrambling on free()
diff -ru bash-5.1.orig/lib/sh/oslib.c bash-5.1/lib/sh/oslib.c
--- bash-5.1.orig/lib/sh/oslib.c	2013-10-14 15:12:57.000000000 +0200
+++ bash-5.1/lib/sh/oslib.c	2020-12-08 14:35:05.062112859 +0100
@@ -280,7 +280,7 @@
 long
 getmaxchild ()
 {
-  static long maxchild = -1L;
+  static long maxchild = _SC_CHILD_MAX;
 
   if (maxchild > 0)
     return maxchild;
--- bash-5.1.8/builtins/psize.sh.orig	2013-10-14 15:14:35.000000000 +0200
+++ bash-5.1.8/builtins/psize.sh	2021-08-19 09:16:16.724336836 +0200
@@ -1,21 +1,6 @@
 #! /bin/sh
 #
-# psize.sh -- determine this system's pipe size, and write a define to
-#             pipesize.h so ulimit.c can use it.
-
-: ${TMPDIR:=/tmp}
-# try to use mktemp(1) if the system supports it
-{ TMPFILE="`mktemp $TMPDIR/pipsize.XXXXXX 2>/dev/null`"; } 2>/dev/null
-used_mktemp=true
-
-if [ -z "$TMPFILE" ]; then
-	TMPNAME=pipsize.$$
-	TMPFILE=$TMPDIR/$TMPNAME
-	used_mktemp=false
-fi
-
-trap 'rm -f "$TMPFILE" ; exit 1' 1 2 3 6 15
-trap 'rm -f "$TMPFILE"' 0
+# psize.sh -- write midipix' pipe size define to pipesize.h so ulimit.c can use it.
 
 echo "/*"
 echo " * pipesize.h"
@@ -24,22 +9,6 @@
 echo " * Do not edit!"
 echo " */"
 echo ""
-
-#
-# Try to avoid tempfile races.  We can't really check for the file's
-# existence before we run psize.aux, because `test -e' is not portable,
-# `test -h' (test for symlinks) is not portable, and `test -f' only
-# checks for regular files.  If we used mktemp(1), we're ahead of the
-# game.
-#
-$used_mktemp || rm -f "$TMPFILE"
-
-./psize.aux 2>"$TMPFILE" | sleep 3
-
-if [ -s "$TMPFILE" ]; then
-	echo "#define PIPESIZE `cat "$TMPFILE"`"
-else
-	echo "#define PIPESIZE 512"
-fi
+echo "#define PIPESIZE 512"
 
 exit 0