mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-06-28 16:09:51 +02:00
commit bash-20091210 snapshot
This commit is contained in:
@@ -1,3 +1,35 @@
|
||||
This document details the changes between this version, bash-4.1-rc,
|
||||
and the previous version, bash-4.1-beta.
|
||||
|
||||
1. Changes to Bash
|
||||
|
||||
a. Fixed a bug that caused printf to not return a partial value when it
|
||||
encountered an error while converting an integer argument.
|
||||
|
||||
b. Fixed a bug that caused setting one of the compatNN options to not
|
||||
turn off the others.
|
||||
|
||||
c. The (undocumented) --wordexp option is no longer included by default.
|
||||
|
||||
d. Fixed a bug in conditional command execution that caused it to not
|
||||
correctly ignore the exit status under certain circumstances.
|
||||
|
||||
e. Added a configure-time check for correctly-working asprintf/snprintf.
|
||||
|
||||
f. Fixed some problems with line number calculation and display when sourcing
|
||||
a file in an interactive shell.
|
||||
|
||||
g. Fixed a bug that caused the shell to crash when using `declare -A foo=bar'.
|
||||
|
||||
h. Fixed a bug that caused an off-by-one error when calculating the directories
|
||||
to display with the PROMPT_DIRTRIM option.
|
||||
|
||||
2. Changes to Readline
|
||||
|
||||
a. Fixed a bug that caused applications using the callback interface to not
|
||||
react to SIGINT (or other signals) until another character arrived.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
This document details the changes between this version, bash-4.1-beta,
|
||||
and the previous version, bash-4.1-alpha.
|
||||
|
||||
|
||||
@@ -1,3 +1,58 @@
|
||||
This document details the changes between this version, bash-4.1-beta,
|
||||
and the previous version, bash-4.1-alpha.
|
||||
|
||||
1. Changes to Bash
|
||||
|
||||
a. Fixed a bug in mapfile that caused the shell to crash if it was passed the
|
||||
name of an associative array.
|
||||
|
||||
b. Fixed a bug that caused the shell to incorrectly split case patterns if
|
||||
they contained characters in $IFS.
|
||||
|
||||
c. Fixed a bug that caused the shell to set $? to the wrong value when using
|
||||
a construct ending with a variable assignment with set -x enabled and PS4
|
||||
containing a command substitution.
|
||||
|
||||
d. Fixed a bug that caused the shell to read commands incorrectly if an
|
||||
expansion error occurred under certain conditions in a user-specified
|
||||
subshell.
|
||||
|
||||
e. Fixed a bug that caused the shell to set $? incorrectly if a parse error
|
||||
occurred in an evaluation context ("eval", trap command, dot script, etc.)
|
||||
|
||||
f. Fixed a bug that caused the shell to attempt command substitution
|
||||
completion within a single-quoted string.
|
||||
|
||||
g. Fixed a bug that caused the shell to insert an extra single quote during
|
||||
word completion.
|
||||
|
||||
h. Fixed a bug that caused the shell to crash if invoked with the environment
|
||||
variable EMACS having a null value.
|
||||
|
||||
i. Fixed a bug that caused bash to incorrectly report the presence of new
|
||||
mail in a `maildir' environment.
|
||||
|
||||
j. Fixed a bug that caused the shell to not recognize a here-document ending
|
||||
delimiter inside a command substitution.
|
||||
|
||||
k. Fixed a bug that caused the shell to crash when a a dynamic array variable
|
||||
was assigned a scalar value.
|
||||
|
||||
2. Changes to Readline
|
||||
|
||||
3. New Features in Bash
|
||||
|
||||
a. The mapfile/readarray builtin no longer stores the commands it invokes via
|
||||
callbacks in the history list.
|
||||
|
||||
b. There is a new `compat40' shopt option.
|
||||
|
||||
c. The < and > operators to [[ do string comparisons using the current locale
|
||||
only if the compatibility level is greater than 40 (set to 41 by default).
|
||||
|
||||
4. New Features in Readline
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
This document details the changes between this version, bash-4.1-alpha,
|
||||
and the previous version, bash-4.0-release.
|
||||
|
||||
|
||||
@@ -9161,6 +9161,10 @@ builtins/printf.def
|
||||
value accumulated so far, which is suppose to be what
|
||||
strtoimax/strtoll/strtol returns
|
||||
|
||||
11/17
|
||||
-----
|
||||
[bash-4.1-beta released]
|
||||
|
||||
11/18
|
||||
-----
|
||||
builtins/{common.h,shopt.def},shell.c
|
||||
|
||||
@@ -9262,3 +9262,7 @@ lib/readline/signals.c
|
||||
_rl_interrupt_immediately is set, so RL_CHECK_SIGNALS doesn't
|
||||
cause it to be processed twice. Suggested by Jan Kratochvil
|
||||
<jan.kratochvil@redhat.com>
|
||||
- if the callback interface is being used, use the code path that
|
||||
immediately handles signals. This restores the readline-5.2
|
||||
behavior. Fixes GDB readline bug reported by Jan Kratochvil
|
||||
<jan.kratochvil@redhat.com>
|
||||
|
||||
@@ -1529,3 +1529,9 @@ e. There are new library functions and variables available to application
|
||||
|
||||
f. The NEWLINE character (^J) is now treated as a search terminator by the
|
||||
incremental search functions.
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Copying and distribution of this file, with or without modification,
|
||||
are permitted in any medium without royalty provided the copyright
|
||||
notice and this notice are preserved. This file is offered as-is,
|
||||
without any warranty.
|
||||
|
||||
@@ -73,6 +73,14 @@ t. Changed the behavior of interrupting the wait builtin when a SIGCHLD is
|
||||
u. The read builtin has a new `-N nchars' option, which reads exactly NCHARS
|
||||
characters, ignoring delimiters like newline.
|
||||
|
||||
v. The mapfile/readarray builtin no longer stores the commands it invokes via
|
||||
callbacks in the history list.
|
||||
|
||||
w. There is a new `compat40' shopt option.
|
||||
|
||||
x. The < and > operators to [[ do string comparisons using the current locale
|
||||
only if the compatibility level is greater than 40 (set to 41 by default).
|
||||
|
||||
2. New Features in Readline
|
||||
|
||||
a. New bindable function: menu-complete-backward.
|
||||
@@ -1521,3 +1529,9 @@ e. There are new library functions and variables available to application
|
||||
|
||||
f. The NEWLINE character (^J) is now treated as a search terminator by the
|
||||
incremental search functions.
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
Copying and distribution of this file, with or without modification,
|
||||
are permitted in any medium without royalty provided the copyright
|
||||
notice and this notice are preserved. This file is offered as-is,
|
||||
without any warranty.
|
||||
|
||||
@@ -89,3 +89,8 @@ Enjoy!
|
||||
|
||||
Chet Ramey
|
||||
chet.ramey@case.edu
|
||||
|
||||
Copying and distribution of this file, with or without modification,
|
||||
are permitted in any medium without royalty provided the copyright
|
||||
notice and this notice are preserved. This file is offered as-is,
|
||||
without any warranty.
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
Introduction
|
||||
============
|
||||
|
||||
This is GNU Bash, version 4.1. Bash is the GNU Project's Bourne
|
||||
Again SHell, a complete implementation of the POSIX.2 shell spec,
|
||||
but also with interactive command line editing, job control on
|
||||
architectures that support it, csh-like features such as history
|
||||
substitution and brace expansion, and a slew of other features.
|
||||
For more information on the features of Bash that are new to this
|
||||
type of shell, see the file `doc/bashref.texi'. There is also a
|
||||
large Unix-style man page. The man page is the definitive description
|
||||
of the shell's features.
|
||||
|
||||
See the file POSIX for a discussion of how the Bash defaults differ
|
||||
from the POSIX.2 spec and a description of the Bash `posix mode'.
|
||||
|
||||
There are some user-visible incompatibilities between this version
|
||||
of Bash and previous widely-distributed versions, bash-2.05b and
|
||||
bash-3.2. For details, see the file COMPAT. The NEWS file tersely
|
||||
lists features that are new in this release.
|
||||
|
||||
Bash is free software, distributed under the terms of the [GNU] General
|
||||
Public License as published by the Free Software Foundation,
|
||||
version 3 of the License (or any later version). For more information,
|
||||
see the file COPYING.
|
||||
|
||||
A number of frequently-asked questions are answered in the file
|
||||
`doc/FAQ'.
|
||||
|
||||
To compile Bash, try typing `./configure', then `make'. Bash
|
||||
auto-configures the build process, so no further intervention
|
||||
should be necessary. Bash builds with `gcc' by default if it is
|
||||
available. If you want to use `cc' instead, type
|
||||
|
||||
CC=cc ./configure
|
||||
|
||||
if you are using a Bourne-style shell. If you are not, the following
|
||||
may work:
|
||||
|
||||
env CC=cc ./configure
|
||||
|
||||
Read the file INSTALL in this directory for more information about how
|
||||
to customize and control the build process. The file NOTES contains
|
||||
platform-specific installation and configuration information.
|
||||
|
||||
If you are a csh user and wish to convert your csh aliases to Bash
|
||||
aliases, you may wish to use the script `examples/misc/alias-conv.sh'
|
||||
as a starting point. The script `examples/misc/cshtobash' is a
|
||||
more ambitious script that attempts to do a more complete job.
|
||||
|
||||
Reporting Bugs
|
||||
==============
|
||||
|
||||
Bug reports for bash should be sent to:
|
||||
|
||||
bug-bash@gnu.org
|
||||
|
||||
using the `bashbug' program that is built and installed at the same
|
||||
time as bash.
|
||||
|
||||
The discussion list `bug-bash@gnu.org' often contains information
|
||||
about new ports of Bash, or discussions of new features or behavior
|
||||
changes that people would like. This mailing list is also available
|
||||
as a usenet newsgroup: gnu.bash.bug.
|
||||
|
||||
When you send a bug report, please use the `bashbug' program that is
|
||||
built at the same time as bash. If bash fails to build, try building
|
||||
bashbug directly with `make bashbug'. If you cannot build `bashbug',
|
||||
please send mail to bug-bash@gnu.org with the following information:
|
||||
|
||||
* the version number and release status of Bash (e.g., 2.05a-release)
|
||||
* the machine and OS that it is running on (you may run
|
||||
`bashversion -l' from the bash build directory for this information)
|
||||
* a list of the compilation flags or the contents of `config.h', if
|
||||
appropriate
|
||||
* a description of the bug
|
||||
* a recipe for recreating the bug reliably
|
||||
* a fix for the bug if you have one!
|
||||
|
||||
The `bashbug' program includes much of this automatically.
|
||||
|
||||
If you would like to contact the Bash maintainers directly, send mail
|
||||
to bash-maintainers@gnu.org.
|
||||
|
||||
While the Bash maintainers do not promise to fix all bugs, we would
|
||||
like this shell to be the best that we can make it.
|
||||
|
||||
Enjoy!
|
||||
|
||||
Chet Ramey
|
||||
chet.ramey@case.edu
|
||||
+10
-10
@@ -1,7 +1,7 @@
|
||||
@%:@! /bin/sh
|
||||
@%:@ From configure.in for Bash 4.1, version 4.018.
|
||||
@%:@ Guess values for system-dependent variables and create Makefiles.
|
||||
@%:@ Generated by GNU Autoconf 2.63 for bash 4.1-rc.
|
||||
@%:@ Generated by GNU Autoconf 2.63 for bash 4.1-rc1.
|
||||
@%:@
|
||||
@%:@ Report bugs to <bug-bash@gnu.org>.
|
||||
@%:@
|
||||
@@ -597,8 +597,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
|
||||
# Identity of this package.
|
||||
PACKAGE_NAME='bash'
|
||||
PACKAGE_TARNAME='bash'
|
||||
PACKAGE_VERSION='4.1-rc'
|
||||
PACKAGE_STRING='bash 4.1-rc'
|
||||
PACKAGE_VERSION='4.1-rc1'
|
||||
PACKAGE_STRING='bash 4.1-rc1'
|
||||
PACKAGE_BUGREPORT='bug-bash@gnu.org'
|
||||
|
||||
ac_unique_file="shell.h"
|
||||
@@ -1411,7 +1411,7 @@ if test "$ac_init_help" = "long"; then
|
||||
# Omit some internal or obsolete options to make the list less imposing.
|
||||
# This message is too long to be a string in the A/UX 3.1 sh.
|
||||
cat <<_ACEOF
|
||||
\`configure' configures bash 4.1-rc to adapt to many kinds of systems.
|
||||
\`configure' configures bash 4.1-rc1 to adapt to many kinds of systems.
|
||||
|
||||
Usage: $0 [OPTION]... [VAR=VALUE]...
|
||||
|
||||
@@ -1476,7 +1476,7 @@ fi
|
||||
|
||||
if test -n "$ac_init_help"; then
|
||||
case $ac_init_help in
|
||||
short | recursive ) echo "Configuration of bash 4.1-rc:";;
|
||||
short | recursive ) echo "Configuration of bash 4.1-rc1:";;
|
||||
esac
|
||||
cat <<\_ACEOF
|
||||
|
||||
@@ -1652,7 +1652,7 @@ fi
|
||||
test -n "$ac_init_help" && exit $ac_status
|
||||
if $ac_init_version; then
|
||||
cat <<\_ACEOF
|
||||
bash configure 4.1-rc
|
||||
bash configure 4.1-rc1
|
||||
generated by GNU Autoconf 2.63
|
||||
|
||||
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
|
||||
@@ -1666,7 +1666,7 @@ cat >config.log <<_ACEOF
|
||||
This file contains any messages produced by compilers while
|
||||
running configure, to aid debugging if configure makes a mistake.
|
||||
|
||||
It was created by bash $as_me 4.1-rc, which was
|
||||
It was created by bash $as_me 4.1-rc1, which was
|
||||
generated by GNU Autoconf 2.63. Invocation command line was
|
||||
|
||||
$ $0 $@
|
||||
@@ -2080,7 +2080,7 @@ ac_config_headers="$ac_config_headers config.h"
|
||||
|
||||
|
||||
BASHVERS=4.1
|
||||
RELSTATUS=rc
|
||||
RELSTATUS=rc1
|
||||
|
||||
case "$RELSTATUS" in
|
||||
alp*|bet*|dev*|rc*|maint*) DEBUG='-DDEBUG' MALLOC_DEBUG='-DMALLOC_DEBUG' ;;
|
||||
@@ -31170,7 +31170,7 @@ exec 6>&1
|
||||
# report actual input values of CONFIG_FILES etc. instead of their
|
||||
# values after options handling.
|
||||
ac_log="
|
||||
This file was extended by bash $as_me 4.1-rc, which was
|
||||
This file was extended by bash $as_me 4.1-rc1, which was
|
||||
generated by GNU Autoconf 2.63. Invocation command line was
|
||||
|
||||
CONFIG_FILES = $CONFIG_FILES
|
||||
@@ -31233,7 +31233,7 @@ Report bugs to <bug-autoconf@gnu.org>."
|
||||
_ACEOF
|
||||
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
|
||||
ac_cs_version="\\
|
||||
bash config.status 4.1-rc
|
||||
bash config.status 4.1-rc1
|
||||
configured by $0, generated by GNU Autoconf 2.63,
|
||||
with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
|
||||
|
||||
|
||||
+11
-11
@@ -15,25 +15,25 @@
|
||||
'configure.in'
|
||||
],
|
||||
{
|
||||
'_LT_AC_TAGCONFIG' => 1,
|
||||
'AM_PROG_F77_C_O' => 1,
|
||||
'AC_INIT' => 1,
|
||||
'_LT_AC_TAGCONFIG' => 1,
|
||||
'm4_pattern_forbid' => 1,
|
||||
'_AM_COND_IF' => 1,
|
||||
'AC_INIT' => 1,
|
||||
'AC_CANONICAL_TARGET' => 1,
|
||||
'AC_SUBST' => 1,
|
||||
'_AM_COND_IF' => 1,
|
||||
'AC_CONFIG_LIBOBJ_DIR' => 1,
|
||||
'AC_FC_SRCEXT' => 1,
|
||||
'AC_SUBST' => 1,
|
||||
'AC_CANONICAL_HOST' => 1,
|
||||
'AC_FC_SRCEXT' => 1,
|
||||
'AC_PROG_LIBTOOL' => 1,
|
||||
'AM_INIT_AUTOMAKE' => 1,
|
||||
'AC_CONFIG_SUBDIRS' => 1,
|
||||
'AM_AUTOMAKE_VERSION' => 1,
|
||||
'LT_CONFIG_LTDL_DIR' => 1,
|
||||
'AC_REQUIRE_AUX_FILE' => 1,
|
||||
'AC_CONFIG_LINKS' => 1,
|
||||
'm4_sinclude' => 1,
|
||||
'AC_REQUIRE_AUX_FILE' => 1,
|
||||
'LT_SUPPORTED_TAG' => 1,
|
||||
'm4_sinclude' => 1,
|
||||
'AM_MAINTAINER_MODE' => 1,
|
||||
'AM_GNU_GETTEXT_INTL_SUBDIR' => 1,
|
||||
'_m4_warn' => 1,
|
||||
@@ -49,13 +49,13 @@
|
||||
'AC_CANONICAL_BUILD' => 1,
|
||||
'AC_FC_FREEFORM' => 1,
|
||||
'AH_OUTPUT' => 1,
|
||||
'_AM_SUBST_NOTMAKE' => 1,
|
||||
'AC_CONFIG_AUX_DIR' => 1,
|
||||
'sinclude' => 1,
|
||||
'm4_pattern_allow' => 1,
|
||||
'_AM_SUBST_NOTMAKE' => 1,
|
||||
'AM_PROG_CC_C_O' => 1,
|
||||
'AC_CANONICAL_SYSTEM' => 1,
|
||||
'm4_pattern_allow' => 1,
|
||||
'sinclude' => 1,
|
||||
'AM_CONDITIONAL' => 1,
|
||||
'AC_CANONICAL_SYSTEM' => 1,
|
||||
'AC_CONFIG_HEADERS' => 1,
|
||||
'AC_DEFINE_TRACE_LITERAL' => 1,
|
||||
'm4_include' => 1,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
m4trace:configure.in:29: -1- AC_INIT([bash], [4.1-rc], [bug-bash@gnu.org])
|
||||
m4trace:configure.in:29: -1- AC_INIT([bash], [4.1-rc1], [bug-bash@gnu.org])
|
||||
m4trace:configure.in:29: -1- m4_pattern_forbid([^_?A[CHUM]_])
|
||||
m4trace:configure.in:29: -1- m4_pattern_forbid([_AC_])
|
||||
m4trace:configure.in:29: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS'])
|
||||
|
||||
+4
-1
@@ -121,6 +121,9 @@ kill_builtin (list)
|
||||
else
|
||||
sig = decode_signal (sigspec, dflags);
|
||||
list = list->next;
|
||||
#if 0
|
||||
saw_signal++; /* XXX - for bash-4.2 */
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -141,7 +144,7 @@ kill_builtin (list)
|
||||
/* If this is a signal specification then process it. We only process
|
||||
the first one seen; other arguments may signify process groups (e.g,
|
||||
-num == process group num). */
|
||||
else if ((*word == '-') && !saw_signal)
|
||||
else if (*word == '-' && saw_signal == 0)
|
||||
{
|
||||
sigspec = word + 1;
|
||||
sig = decode_signal (sigspec, dflags);
|
||||
|
||||
@@ -0,0 +1,263 @@
|
||||
This file is kill.def, from which is created kill.c.
|
||||
It implements the builtin "kill" in Bash.
|
||||
|
||||
Copyright (C) 1987-2009 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Bash, the Bourne Again SHell.
|
||||
|
||||
Bash is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Bash is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with Bash. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
$PRODUCES kill.c
|
||||
|
||||
$BUILTIN kill
|
||||
$FUNCTION kill_builtin
|
||||
$SHORT_DOC kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
|
||||
Send a signal to a job.
|
||||
|
||||
Send the processes identified by PID or JOBSPEC the signal named by
|
||||
SIGSPEC or SIGNUM. If neither SIGSPEC nor SIGNUM is present, then
|
||||
SIGTERM is assumed.
|
||||
|
||||
Options:
|
||||
-s sig SIG is a signal name
|
||||
-n sig SIG is a signal number
|
||||
-l list the signal names; if arguments follow `-l' they are
|
||||
assumed to be signal numbers for which names should be listed
|
||||
|
||||
Kill is a shell builtin for two reasons: it allows job IDs to be used
|
||||
instead of process IDs, and allows processes to be killed if the limit
|
||||
on processes that you can create is reached.
|
||||
|
||||
Exit Status:
|
||||
Returns success unless an invalid option is given or an error occurs.
|
||||
$END
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#if defined (HAVE_UNISTD_H)
|
||||
# ifdef _MINIX
|
||||
# include <sys/types.h>
|
||||
# endif
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include "../bashansi.h"
|
||||
#include "../bashintl.h"
|
||||
|
||||
#include "../shell.h"
|
||||
#include "../trap.h"
|
||||
#include "../jobs.h"
|
||||
#include "common.h"
|
||||
|
||||
/* Not all systems declare ERRNO in errno.h... and some systems #define it! */
|
||||
#if !defined (errno)
|
||||
extern int errno;
|
||||
#endif /* !errno */
|
||||
|
||||
extern int posixly_correct;
|
||||
|
||||
static void kill_error __P((pid_t, int));
|
||||
|
||||
#if !defined (CONTINUE_AFTER_KILL_ERROR)
|
||||
# define CONTINUE_OR_FAIL return (EXECUTION_FAILURE)
|
||||
#else
|
||||
# define CONTINUE_OR_FAIL goto continue_killing
|
||||
#endif /* CONTINUE_AFTER_KILL_ERROR */
|
||||
|
||||
/* Here is the kill builtin. We only have it so that people can type
|
||||
kill -KILL %1? No, if you fill up the process table this way you
|
||||
can still kill some. */
|
||||
int
|
||||
kill_builtin (list)
|
||||
WORD_LIST *list;
|
||||
{
|
||||
int sig, any_succeeded, listing, saw_signal, dflags;
|
||||
char *sigspec, *word;
|
||||
pid_t pid;
|
||||
intmax_t pid_value;
|
||||
|
||||
if (list == 0)
|
||||
{
|
||||
builtin_usage ();
|
||||
return (EXECUTION_FAILURE);
|
||||
}
|
||||
|
||||
any_succeeded = listing = saw_signal = 0;
|
||||
sig = SIGTERM;
|
||||
sigspec = "TERM";
|
||||
|
||||
dflags = DSIG_NOCASE | ((posixly_correct == 0) ? DSIG_SIGPREFIX : 0);
|
||||
/* Process options. */
|
||||
while (list)
|
||||
{
|
||||
word = list->word->word;
|
||||
|
||||
if (ISOPTION (word, 'l'))
|
||||
{
|
||||
listing++;
|
||||
list = list->next;
|
||||
}
|
||||
else if (ISOPTION (word, 's') || ISOPTION (word, 'n'))
|
||||
{
|
||||
list = list->next;
|
||||
if (list)
|
||||
{
|
||||
sigspec = list->word->word;
|
||||
if (sigspec[0] == '0' && sigspec[1] == '\0')
|
||||
sig = 0;
|
||||
else
|
||||
sig = decode_signal (sigspec, dflags);
|
||||
list = list->next;
|
||||
saw_signal++;
|
||||
}
|
||||
else
|
||||
{
|
||||
sh_needarg (word);
|
||||
return (EXECUTION_FAILURE);
|
||||
}
|
||||
}
|
||||
else if (ISOPTION (word, '-'))
|
||||
{
|
||||
list = list->next;
|
||||
break;
|
||||
}
|
||||
else if (ISOPTION (word, '?'))
|
||||
{
|
||||
builtin_usage ();
|
||||
return (EXECUTION_SUCCESS);
|
||||
}
|
||||
/* If this is a signal specification then process it. We only process
|
||||
the first one seen; other arguments may signify process groups (e.g,
|
||||
-num == process group num). */
|
||||
else if (*word == '-' && saw_signal == 0)
|
||||
{
|
||||
sigspec = word + 1;
|
||||
sig = decode_signal (sigspec, dflags);
|
||||
saw_signal++;
|
||||
list = list->next;
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
if (listing)
|
||||
return (display_signal_list (list, 0));
|
||||
|
||||
/* OK, we are killing processes. */
|
||||
if (sig == NO_SIG)
|
||||
{
|
||||
sh_invalidsig (sigspec);
|
||||
return (EXECUTION_FAILURE);
|
||||
}
|
||||
|
||||
if (list == 0)
|
||||
{
|
||||
builtin_usage ();
|
||||
return (EXECUTION_FAILURE);
|
||||
}
|
||||
|
||||
while (list)
|
||||
{
|
||||
word = list->word->word;
|
||||
|
||||
if (*word == '-')
|
||||
word++;
|
||||
|
||||
/* Use the entire argument in case of minus sign presence. */
|
||||
if (*word && legal_number (list->word->word, &pid_value) && (pid_value == (pid_t)pid_value))
|
||||
{
|
||||
pid = (pid_t) pid_value;
|
||||
|
||||
if (kill_pid (pid, sig, pid < -1) < 0)
|
||||
{
|
||||
if (errno == EINVAL)
|
||||
sh_invalidsig (sigspec);
|
||||
else
|
||||
kill_error (pid, errno);
|
||||
CONTINUE_OR_FAIL;
|
||||
}
|
||||
else
|
||||
any_succeeded++;
|
||||
}
|
||||
#if defined (JOB_CONTROL)
|
||||
else if (*list->word->word && *list->word->word != '%')
|
||||
{
|
||||
builtin_error (_("%s: arguments must be process or job IDs"), list->word->word);
|
||||
CONTINUE_OR_FAIL;
|
||||
}
|
||||
else if (*word)
|
||||
/* Posix.2 says you can kill without job control active (4.32.4) */
|
||||
{ /* Must be a job spec. Check it out. */
|
||||
int job;
|
||||
sigset_t set, oset;
|
||||
JOB *j;
|
||||
|
||||
BLOCK_CHILD (set, oset);
|
||||
job = get_job_spec (list);
|
||||
|
||||
if (INVALID_JOB (job))
|
||||
{
|
||||
if (job != DUP_JOB)
|
||||
sh_badjob (list->word->word);
|
||||
UNBLOCK_CHILD (oset);
|
||||
CONTINUE_OR_FAIL;
|
||||
}
|
||||
|
||||
j = get_job_by_jid (job);
|
||||
/* Job spec used. Kill the process group. If the job was started
|
||||
without job control, then its pgrp == shell_pgrp, so we have
|
||||
to be careful. We take the pid of the first job in the pipeline
|
||||
in that case. */
|
||||
pid = IS_JOBCONTROL (job) ? j->pgrp : j->pipe->pid;
|
||||
|
||||
UNBLOCK_CHILD (oset);
|
||||
|
||||
if (kill_pid (pid, sig, 1) < 0)
|
||||
{
|
||||
if (errno == EINVAL)
|
||||
sh_invalidsig (sigspec);
|
||||
else
|
||||
kill_error (pid, errno);
|
||||
CONTINUE_OR_FAIL;
|
||||
}
|
||||
else
|
||||
any_succeeded++;
|
||||
}
|
||||
#endif /* !JOB_CONTROL */
|
||||
else
|
||||
{
|
||||
sh_badpid (list->word->word);
|
||||
CONTINUE_OR_FAIL;
|
||||
}
|
||||
continue_killing:
|
||||
list = list->next;
|
||||
}
|
||||
|
||||
return (any_succeeded ? EXECUTION_SUCCESS : EXECUTION_FAILURE);
|
||||
}
|
||||
|
||||
static void
|
||||
kill_error (pid, e)
|
||||
pid_t pid;
|
||||
int e;
|
||||
{
|
||||
char *x;
|
||||
|
||||
x = strerror (e);
|
||||
if (x == 0)
|
||||
x = _("Unknown error");
|
||||
builtin_error ("(%ld) - %s", (long)pid, x);
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
#! /bin/sh
|
||||
# From configure.in for Bash 4.1, version 4.018.
|
||||
# Guess values for system-dependent variables and create Makefiles.
|
||||
# Generated by GNU Autoconf 2.63 for bash 4.1-rc.
|
||||
# Generated by GNU Autoconf 2.63 for bash 4.1-rc1.
|
||||
#
|
||||
# Report bugs to <bug-bash@gnu.org>.
|
||||
#
|
||||
@@ -597,8 +597,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
|
||||
# Identity of this package.
|
||||
PACKAGE_NAME='bash'
|
||||
PACKAGE_TARNAME='bash'
|
||||
PACKAGE_VERSION='4.1-rc'
|
||||
PACKAGE_STRING='bash 4.1-rc'
|
||||
PACKAGE_VERSION='4.1-rc1'
|
||||
PACKAGE_STRING='bash 4.1-rc1'
|
||||
PACKAGE_BUGREPORT='bug-bash@gnu.org'
|
||||
|
||||
ac_unique_file="shell.h"
|
||||
@@ -1411,7 +1411,7 @@ if test "$ac_init_help" = "long"; then
|
||||
# Omit some internal or obsolete options to make the list less imposing.
|
||||
# This message is too long to be a string in the A/UX 3.1 sh.
|
||||
cat <<_ACEOF
|
||||
\`configure' configures bash 4.1-rc to adapt to many kinds of systems.
|
||||
\`configure' configures bash 4.1-rc1 to adapt to many kinds of systems.
|
||||
|
||||
Usage: $0 [OPTION]... [VAR=VALUE]...
|
||||
|
||||
@@ -1476,7 +1476,7 @@ fi
|
||||
|
||||
if test -n "$ac_init_help"; then
|
||||
case $ac_init_help in
|
||||
short | recursive ) echo "Configuration of bash 4.1-rc:";;
|
||||
short | recursive ) echo "Configuration of bash 4.1-rc1:";;
|
||||
esac
|
||||
cat <<\_ACEOF
|
||||
|
||||
@@ -1652,7 +1652,7 @@ fi
|
||||
test -n "$ac_init_help" && exit $ac_status
|
||||
if $ac_init_version; then
|
||||
cat <<\_ACEOF
|
||||
bash configure 4.1-rc
|
||||
bash configure 4.1-rc1
|
||||
generated by GNU Autoconf 2.63
|
||||
|
||||
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
|
||||
@@ -1666,7 +1666,7 @@ cat >config.log <<_ACEOF
|
||||
This file contains any messages produced by compilers while
|
||||
running configure, to aid debugging if configure makes a mistake.
|
||||
|
||||
It was created by bash $as_me 4.1-rc, which was
|
||||
It was created by bash $as_me 4.1-rc1, which was
|
||||
generated by GNU Autoconf 2.63. Invocation command line was
|
||||
|
||||
$ $0 $@
|
||||
@@ -2080,7 +2080,7 @@ ac_config_headers="$ac_config_headers config.h"
|
||||
|
||||
|
||||
BASHVERS=4.1
|
||||
RELSTATUS=rc
|
||||
RELSTATUS=rc1
|
||||
|
||||
case "$RELSTATUS" in
|
||||
alp*|bet*|dev*|rc*|maint*) DEBUG='-DDEBUG' MALLOC_DEBUG='-DMALLOC_DEBUG' ;;
|
||||
@@ -31170,7 +31170,7 @@ exec 6>&1
|
||||
# report actual input values of CONFIG_FILES etc. instead of their
|
||||
# values after options handling.
|
||||
ac_log="
|
||||
This file was extended by bash $as_me 4.1-rc, which was
|
||||
This file was extended by bash $as_me 4.1-rc1, which was
|
||||
generated by GNU Autoconf 2.63. Invocation command line was
|
||||
|
||||
CONFIG_FILES = $CONFIG_FILES
|
||||
@@ -31233,7 +31233,7 @@ Report bugs to <bug-autoconf@gnu.org>."
|
||||
_ACEOF
|
||||
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
|
||||
ac_cs_version="\\
|
||||
bash config.status 4.1-rc
|
||||
bash config.status 4.1-rc1
|
||||
configured by $0, generated by GNU Autoconf 2.63,
|
||||
with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
|
||||
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@ dnl Process this file with autoconf to produce a configure script.
|
||||
AC_REVISION([for Bash 4.1, version 4.018])dnl
|
||||
|
||||
define(bashvers, 4.1)
|
||||
define(relstatus, rc)
|
||||
define(relstatus, rc1)
|
||||
|
||||
AC_INIT([bash], bashvers-relstatus, [bug-bash@gnu.org])
|
||||
|
||||
|
||||
+2
-2
@@ -21,10 +21,10 @@ 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 4.1, version 4.016])dnl
|
||||
AC_REVISION([for Bash 4.1, version 4.018])dnl
|
||||
|
||||
define(bashvers, 4.1)
|
||||
define(relstatus, beta)
|
||||
define(relstatus, rc)
|
||||
|
||||
AC_INIT([bash], bashvers-relstatus, [bug-bash@gnu.org])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user