commit bash-20200626 snapshot

This commit is contained in:
Chet Ramey
2020-06-30 15:09:56 -04:00
parent 6edcd70089
commit dd4e3abc5c
9 changed files with 78 additions and 29 deletions
+19
View File
@@ -8610,3 +8610,22 @@ lib/sh/zcatfd.c
lib/sh/zmapfd.c
- zmapfd: lbuf: bump size up to ZBUFSIZ (default 4096)
6/29
----
aclocal.m4
- BASH_FUNC_SBRK: changes for cross-compiling on FreeBSD variants,
from Jessica Clarke <jrtc27@jrtc27.com>
xmalloc.c
- HAVE_SBRK: use #if instead of #ifdef so we only use it if we think
it works
examples/loadables/finfo.c
- st_dev,st_nlink: cast to unsigned long, report from Jessica Clarke
<jrtc27@jrtc27.com>
unwind_prot.c
- unwind_protect_mem_internal: make sure we allocate at least as many
bytes for an entire UNWIND_ELT. Fix from Jessica Clarke
<jrtc27@jrtc27.com>
+5 -5
View File
@@ -760,7 +760,7 @@ Makefile makefile: config.status $(srcdir)/Makefile.in
Makefiles makefiles: config.status $(srcdir)/Makefile.in
@for mf in $(CREATED_MAKEFILES); do \
CONFIG_FILES=$$mf CONFIG_HEADERS= $(SHELL) ./config.status ; \
CONFIG_FILES=$$mf CONFIG_HEADERS= $(SHELL) ./config.status || exit 1; \
done
config.h: stamp-h
@@ -846,16 +846,16 @@ install-headers-dirs:
install-headers: install-headers-dirs
@for hf in $(INSTALLED_HEADERS) ; do \
${INSTALL_DATA} $(srcdir)/"$$hf" $(DESTDIR)$(headersdir)/$$hf; \
${INSTALL_DATA} $(srcdir)/"$$hf" $(DESTDIR)$(headersdir)/$$hf || exit 1; \
done
@for hf in $(INSTALLED_INCFILES) ; do \
${INSTALL_DATA} $(BASHINCDIR)/"$$hf" $(DESTDIR)$(headersdir)/include/$$hf; \
${INSTALL_DATA} $(BASHINCDIR)/"$$hf" $(DESTDIR)$(headersdir)/include/$$hf || exit 1; \
done
@for hf in $(INSTALLED_BUILTINS_HEADERS) ; do \
${INSTALL_DATA} $(BUILTIN_SRCDIR)/"$$hf" $(DESTDIR)$(headersdir)/builtins/$$hf; \
${INSTALL_DATA} $(BUILTIN_SRCDIR)/"$$hf" $(DESTDIR)$(headersdir)/builtins/$$hf || exit 1; \
done
@for hf in $(CREATED_HEADERS) ; do \
${INSTALL_DATA} $(BUILD_DIR)/"$$hf" $(DESTDIR)$(headersdir)/$$hf; \
${INSTALL_DATA} $(BUILD_DIR)/"$$hf" $(DESTDIR)$(headersdir)/$$hf || exit 1; \
done
-$(INSTALL_DATA) $(SDIR)/bash.pc $(DESTDIR)$(pkgconfigdir)/bash.pc
Vendored
+8 -3
View File
@@ -2230,7 +2230,12 @@ AC_DEFINE_UNQUOTED([WEXITSTATUS_OFFSET], [$bash_cv_wexitstatus_offset], [Offset
AC_DEFUN([BASH_FUNC_SBRK],
[
AC_CHECK_FUNCS_ONCE([sbrk])
AC_MSG_CHECKING([for sbrk])
AC_CACHE_VAL(ac_cv_func_sbrk,
[AC_TRY_LINK([#include <unistd.h>],
[ void *x = sbrk (4096); ],
ac_cv_func_sbrk=yes, ac_cv_func_sbrk=no)])
AC_MSG_RESULT($ac_cv_func_sbrk)
if test X$ac_cv_func_sbrk = Xyes; then
AC_CACHE_CHECK([for working sbrk], [bash_cv_func_sbrk],
[AC_TRY_RUN([
@@ -2253,8 +2258,8 @@ main(int c, char **v)
ac_cv_func_sbrk=no
fi
fi
if test $ac_cv_func_sbrk = no; then
AC_DEFINE(HAVE_SBRK, 0,
if test $ac_cv_func_sbrk = yes; then
AC_DEFINE(HAVE_SBRK, 1,
[Define if you have a working sbrk function.])
fi
])
Vendored
+32 -6
View File
@@ -1,5 +1,5 @@
#! /bin/sh
# From configure.ac for Bash 5.1, version 5.020.
# From configure.ac for Bash 5.1, version 5.021.
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for bash 5.1-alpha.
#
@@ -2691,7 +2691,6 @@ as_fn_append ac_func_list " uselocale"
as_fn_append ac_header_list " xlocale.h"
as_fn_append ac_header_list " sys/time.h"
as_fn_append ac_func_list " alarm"
as_fn_append ac_func_list " sbrk"
as_fn_append ac_func_list " fpurge"
as_fn_append ac_func_list " __fpurge"
as_fn_append ac_func_list " snprintf"
@@ -2903,6 +2902,9 @@ m68k-sysv) opt_bash_malloc=no ;; # fixes file descriptor leak in closedir
sparc-linux*) opt_bash_malloc=no ;; # sparc running linux; requires ELF
*-aix*) opt_bash_malloc=no ;; # AIX machines
*-cygwin*) opt_bash_malloc=no ;; # Cygnus's CYGWIN environment
# These lack a working sbrk(2)
aarch64-freebsd*) opt_bash_malloc=no ;;
riscv*-freebsd*) opt_bash_malloc=no ;;
# Mach-derived systems have a ton of extra malloc functions and lack sbrk(2)
*-nextstep*) opt_bash_malloc=no ;; # NeXT machines running NeXTstep
*-openstep*) opt_bash_malloc=no ;; # i386/Sparc/HP machines running Openstep
@@ -18541,9 +18543,33 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sbrk" >&5
$as_echo_n "checking for sbrk... " >&6; }
if ${ac_cv_func_sbrk+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <unistd.h>
int
main ()
{
void *x = sbrk (4096);
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_func_sbrk=yes
else
ac_cv_func_sbrk=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_sbrk" >&5
$as_echo "$ac_cv_func_sbrk" >&6; }
if test X$ac_cv_func_sbrk = Xyes; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working sbrk" >&5
$as_echo_n "checking for working sbrk... " >&6; }
@@ -18588,9 +18614,9 @@ $as_echo "$bash_cv_func_sbrk" >&6; }
ac_cv_func_sbrk=no
fi
fi
if test $ac_cv_func_sbrk = no; then
if test $ac_cv_func_sbrk = yes; then
$as_echo "#define HAVE_SBRK 0" >>confdefs.h
$as_echo "#define HAVE_SBRK 1" >>confdefs.h
fi
+4 -1
View File
@@ -21,7 +21,7 @@ dnl Process this file with autoconf to produce a configure script.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
AC_REVISION([for Bash 5.1, version 5.020])dnl
AC_REVISION([for Bash 5.1, version 5.021])dnl
define(bashvers, 5.1)
define(relstatus, alpha)
@@ -77,6 +77,9 @@ m68k-sysv) opt_bash_malloc=no ;; # fixes file descriptor leak in closedir
sparc-linux*) opt_bash_malloc=no ;; # sparc running linux; requires ELF
*-aix*) opt_bash_malloc=no ;; # AIX machines
*-cygwin*) opt_bash_malloc=no ;; # Cygnus's CYGWIN environment
# These lack a working sbrk(2)
aarch64-freebsd*) opt_bash_malloc=no ;;
riscv*-freebsd*) opt_bash_malloc=no ;;
# Mach-derived systems have a ton of extra malloc functions and lack sbrk(2)
*-nextstep*) opt_bash_malloc=no ;; # NeXT machines running NeXTstep
*-openstep*) opt_bash_malloc=no ;; # i386/Sparc/HP machines running Openstep
-6
View File
@@ -5529,12 +5529,6 @@ If set, the @code{echo} builtin expands backslash-escape sequences
by default.
@end table
@noindent
The return status when listing options is zero if all @var{optnames}
are enabled, non-zero otherwise.
When setting or unsetting options, the return status is zero unless an
@var{optname} is not a valid shell option.
@end table
@node Special Builtins
+3 -3
View File
@@ -340,13 +340,13 @@ int flags;
else
printf("%ld\n", st->st_ctime);
} else if (flags & OPT_DEV)
printf("%d\n", st->st_dev);
printf("%lu\n", (unsigned long)st->st_dev);
else if (flags & OPT_INO)
printf("%lu\n", (unsigned long)st->st_ino);
else if (flags & OPT_FID)
printf("%d:%lu\n", st->st_dev, (unsigned long)st->st_ino);
printf("%lu:%lu\n", (unsigned long)st->st_dev, (unsigned long)st->st_ino);
else if (flags & OPT_NLINK)
printf("%d\n", st->st_nlink);
printf("%lu\n", (unsigned long)st->st_nlink);
else if (flags & OPT_LNKNAM) {
#ifdef S_ISLNK
b = xmalloc(4096);
+2
View File
@@ -349,6 +349,8 @@ unwind_protect_mem_internal (var, psize)
size = *(int *) psize;
allocated = size + offsetof (UNWIND_ELT, sv.v.desired_setting[0]);
if (allocated < sizeof (UNWIND_ELT))
allocated = sizeof (UNWIND_ELT);
elt = (UNWIND_ELT *)xmalloc (allocated);
elt->head.next = unwind_protect_list;
elt->head.cleanup = (Function *) restore_variable;
+5 -5
View File
@@ -47,11 +47,11 @@
# endif /* !__STDC__ */
#endif /* !PTR_T */
#if defined (HAVE_SBRK) && !HAVE_DECL_SBRK
#if HAVE_SBRK && !HAVE_DECL_SBRK
extern char *sbrk();
#endif
#if defined (HAVE_SBRK) && defined (USING_BASH_MALLOC)
#if HAVE_SBRK && defined (USING_BASH_MALLOC)
static PTR_T lbreak;
static int brkfound;
static size_t allocated;
@@ -63,7 +63,7 @@ static size_t allocated;
/* */
/* **************************************************************** */
#if defined (HAVE_SBRK) && defined (USING_BASH_MALLOC)
#if HAVE_SBRK && defined (USING_BASH_MALLOC)
#define FINDBRK() \
do { \
if (brkfound == 0) \
@@ -88,7 +88,7 @@ allocerr (func, bytes)
const char *func;
size_t bytes;
{
#if defined (HAVE_SBRK) && defined (USING_BASH_MALLOC)
#if HAVE_SBRK && defined (USING_BASH_MALLOC)
allocated = findbrk ();
fatal_error (_("%s: cannot allocate %lu bytes (%lu bytes allocated)"), func, (unsigned long)bytes, (unsigned long)allocated);
#else
@@ -160,7 +160,7 @@ sh_allocerr (func, bytes, file, line)
char *file;
int line;
{
#if defined (HAVE_SBRK)
#if HAVE_SBRK
allocated = findbrk ();
fatal_error (_("%s: %s:%d: cannot allocate %lu bytes (%lu bytes allocated)"), func, file, line, (unsigned long)bytes, (unsigned long)allocated);
#else