diff --git a/CWRU/CWRU.chlog b/CWRU/CWRU.chlog index 9134bbba..73197636 100644 --- a/CWRU/CWRU.chlog +++ b/CWRU/CWRU.chlog @@ -12004,3 +12004,12 @@ aclocal.m4 with existing set of preprocessor defines, so it can work when cross-compiling. Suggested by Felix Janda + 10/19 + ----- +variables.c + - get_bashpid: BASHPID is no longer readonly; assignments to it are + just ignored. Suggested by Martijn Dekker + +doc/{bash.1,bashref.texi} + - BASHPID: note that assignments are ignored and unsetting BASHPID + causes it to lose its special properties diff --git a/doc/bash.1 b/doc/bash.1 index a1408989..205b2b3b 100644 --- a/doc/bash.1 +++ b/doc/bash.1 @@ -1453,6 +1453,14 @@ This variable is read-only. Expands to the process ID of the current \fBbash\fP process. This differs from \fB$$\fP under certain circumstances, such as subshells that do not require \fBbash\fP to be re-initialized. +Assignments to +.SM +.B BASHPID +have no effect. +If +.B BASHPID +is unset, it loses its special properties, even if it is +subsequently reset. .TP .B BASH_ALIASES An associative array variable whose members correspond to the internal diff --git a/doc/bashref.texi b/doc/bashref.texi index 0b443cc8..9c7c0c73 100644 --- a/doc/bashref.texi +++ b/doc/bashref.texi @@ -5480,6 +5480,10 @@ reading any startup files. This variable is readonly. Expands to the process ID of the current Bash process. This differs from @code{$$} under certain circumstances, such as subshells that do not require Bash to be re-initialized. +Assignments to @env{BASHPID} have no effect. +If @code{BASHPID} +is unset, it loses its special properties, even if it is +subsequently reset. @item BASH_ALIASES An associative array variable whose members correspond to the internal diff --git a/tests/RUN-ONE-TEST b/tests/RUN-ONE-TEST index a5ab273d..d29259a9 100755 --- a/tests/RUN-ONE-TEST +++ b/tests/RUN-ONE-TEST @@ -1,4 +1,4 @@ -BUILD_DIR=/usr/local/build/bash/bash-current +BUILD_DIR=/usr/local/build/chet/bash/bash-current THIS_SH=$BUILD_DIR/bash PATH=$PATH:$BUILD_DIR diff --git a/variables.c b/variables.c index 339b06a5..cc383fde 100644 --- a/variables.c +++ b/variables.c @@ -1462,7 +1462,7 @@ get_bashpid (var) p = itos (pid); FREE (value_cell (var)); - VSETATTR (var, att_integer|att_readonly); + VSETATTR (var, att_integer); /* XXX - was also att_readonly */ var_setvalue (var, p); return (var); } @@ -1767,7 +1767,7 @@ initialize_dynamic_variables () VSETATTR (v, att_integer); INIT_DYNAMIC_VAR ("BASHPID", (char *)NULL, get_bashpid, null_assign); - VSETATTR (v, att_integer|att_readonly); + VSETATTR (v, att_integer); #if defined (HISTORY) INIT_DYNAMIC_VAR ("HISTCMD", (char *)NULL, get_histcmd, (sh_var_assign_func_t *)NULL);