commit bash-20071011 snapshot

This commit is contained in:
Chet Ramey
2011-12-07 09:14:01 -05:00
parent d21bf20140
commit 3d4e09aa28
39 changed files with 7221 additions and 6415 deletions
+4 -4
View File
@@ -108,14 +108,14 @@ int
type_builtin (list)
WORD_LIST *list;
{
int dflags, successful_finds, opt;
int dflags, any_failed, opt;
WORD_LIST *this;
if (list == 0)
return (EXECUTION_SUCCESS);
dflags = CDESC_SHORTDESC; /* default */
successful_finds = 0;
any_failed = 0;
/* Handle the obsolescent `-type', `-path', and `-all' by prescanning
the arguments and converting those options to the form that
@@ -181,11 +181,11 @@ type_builtin (list)
if (!found && (dflags & (CDESC_PATH_ONLY|CDESC_TYPE)) == 0)
sh_notfound (list->word->word);
successful_finds += found;
any_failed += found == 0;
list = list->next;
}
opt = (successful_finds != 0) ? EXECUTION_SUCCESS : EXECUTION_FAILURE;
opt = (any_failed == 0) ? EXECUTION_SUCCESS : EXECUTION_FAILURE;
return (sh_chkwrite (opt));
}
+1 -1
View File
@@ -272,7 +272,7 @@ describe_command (command, dflags)
/* We're blowing away THE_PRINTED_COMMAND here... */
result = named_function_string (command, function_cell (func), FUNC_MULTILINE);
result = named_function_string (command, function_cell (func), FUNC_MULTILINE|FUNC_EXTERNAL);
printf ("%s\n", result);
}
else if (dflags & CDESC_REUSABLE)
+3 -2
View File
@@ -199,15 +199,16 @@ typedef struct {
static RESOURCE_LIMITS limits[] = {
#ifdef RLIMIT_CORE
{ 'c', RLIMIT_CORE, 1024, "core file size", "blocks" },
{ 'c', RLIMIT_CORE, 512, "core file size", "blocks" },
#endif
#ifdef RLIMIT_DATA
{ 'd', RLIMIT_DATA, 1024, "data seg size", "kbytes" },
#endif
#ifdef RLIMIT_NICE
{ 'e', RLIMIT_NICE, 1, "scheduling priority", (char *)NULL },
#endif
{ 'f', RLIMIT_FILESIZE, 1024, "file size", "blocks" },
{ 'f', RLIMIT_FILESIZE, 512, "file size", "blocks" },
#ifdef RLIMIT_SIGPENDING
{ 'i', RLIMIT_SIGPENDING, 1, "pending signals", (char *)NULL },
#endif
+7 -5
View File
@@ -1,7 +1,7 @@
This file is ulimit.def, from which is created ulimit.c.
It implements the builtin "ulimit" in Bash.
Copyright (C) 1987-2006 Free Software Foundation, Inc.
Copyright (C) 1987-2007 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -193,8 +193,8 @@ typedef struct {
int option; /* The ulimit option for this limit. */
int parameter; /* Parameter to pass to get_limit (). */
int block_factor; /* Blocking factor for specific limit. */
char *description; /* Descriptive string to output. */
char *units; /* scale */
const char * const description; /* Descriptive string to output. */
const char * const units; /* scale */
} RESOURCE_LIMITS;
static RESOURCE_LIMITS limits[] = {
@@ -356,7 +356,7 @@ ulimit_builtin (list)
}
#endif
print_all_limits (mode == 0 ? LIMIT_SOFT : mode);
return (EXECUTION_SUCCESS);
return (sh_chkwrite (EXECUTION_SUCCESS));
}
/* default is `ulimit -f' */
@@ -687,7 +687,9 @@ printone (limind, curlim, pdesc)
int pdesc;
{
char unitstr[64];
int factor;
factor = limits[limind].block_factor;
if (pdesc)
{
if (limits[limind].units)
@@ -704,7 +706,7 @@ printone (limind, curlim, pdesc)
else if (curlim == RLIM_SAVED_CUR)
puts ("soft");
else
print_rlimtype ((curlim / limits[limind].block_factor), 1);
print_rlimtype ((curlim / factor), 1);
}
/* Set all limits to NEWLIM. NEWLIM currently must be RLIM_INFINITY, which