bash-4.4 beta2 release

This commit is contained in:
Chet Ramey
2016-07-11 16:52:30 -04:00
parent 690150f9e5
commit a4eef1991c
205 changed files with 21194 additions and 15639 deletions
+1 -1
View File
@@ -52,7 +52,7 @@ isnetconn (fd)
l = sizeof(sa);
rv = getpeername(fd, &sa, &l);
/* Posix.2 says getpeername can return these errors. */
return ((rv < 0 && (errno == ENOTSOCK || errno == ENOTCONN || errno == EINVAL)) ? 0 : 1);
return ((rv < 0 && (errno == ENOTSOCK || errno == ENOTCONN || errno == EINVAL || errno == EBADF)) ? 0 : 1);
#else /* !HAVE_GETPEERNAME || SVR4_2 || __BEOS__ */
# if defined (SVR4) || defined (SVR4_2)
/* Sockets on SVR4 and SVR4.2 are character special (streams) devices. */
+1 -1
View File
@@ -92,7 +92,7 @@ sh_regmatch (string, pattern, flags)
/* Store the parenthesized subexpressions in the array BASH_REMATCH.
Element 0 is the portion that matched the entire regexp. Element 1
is the part that matched the first subexpression, and so on. */
unbind_variable ("BASH_REMATCH");
unbind_variable_noref ("BASH_REMATCH");
rematch = make_new_array_variable ("BASH_REMATCH");
amatch = array_cell (rematch);
+21 -1
View File
@@ -114,6 +114,23 @@ get_tmpdir (flags)
return tdir;
}
static void
sh_seedrand ()
{
#if HAVE_RANDOM
int d;
static int seeded = 0;
if (seeded == 0)
{
struct timeval tv;
gettimeofday (&tv, NULL);
srandom (tv.tv_sec ^ tv.tv_usec ^ (getpid () << 16) ^ (unsigned int)&d);
seeded = 1;
}
#endif
}
char *
sh_mktmpname (nameroot, flags)
char *nameroot;
@@ -122,6 +139,7 @@ sh_mktmpname (nameroot, flags)
char *filename, *tdir, *lroot;
struct stat sb;
int r, tdlen;
static int seeded = 0;
filename = (char *)xmalloc (PATH_MAX + 1);
tdir = get_tmpdir (flags);
@@ -137,6 +155,7 @@ sh_mktmpname (nameroot, flags)
filename = NULL;
}
#else /* !USE_MKTEMP */
sh_seedrand ();
while (1)
{
filenum = (filenum << 1) ^
@@ -167,7 +186,7 @@ sh_mktmpfd (nameroot, flags, namep)
{
char *filename, *tdir, *lroot;
int fd, tdlen;
filename = (char *)xmalloc (PATH_MAX + 1);
tdir = get_tmpdir (flags);
tdlen = strlen (tdir);
@@ -186,6 +205,7 @@ sh_mktmpfd (nameroot, flags, namep)
*namep = filename;
return fd;
#else /* !USE_MKSTEMP */
sh_seedrand ();
do
{
filenum = (filenum << 1) ^