fix for a trap on SIGINT restoring the default disposition in an asynchronous subshell; change cd exit status if -Pe supplied and the directory can't be changed; fix for compound associative array assignment if one of the expanded words unsets the array during word expansion; fixes for rare systems that don't have various defines and system calls

This commit is contained in:
Chet Ramey
2025-11-17 14:50:43 -05:00
parent 81d8584268
commit 2fd02c8387
13 changed files with 113 additions and 62 deletions
+3 -5
View File
@@ -1497,21 +1497,19 @@ time_command (COMMAND *command, int asynchronous, int pipe_in, int pipe_out, str
getrusage (RUSAGE_SELF, &selfb);
getrusage (RUSAGE_CHILDREN, &kidsb);
gettimeofday (&before, NULL);
#else
# if defined (HAVE_TIMES)
#elif defined (HAVE_TIMES)
tbefore = times (&before);
# endif
#endif
/* In posix mode, `time' without argument is equivalent to `times', but
obeys TIMEFORMAT. This is from POSIX interp 267 */
if (posixly_correct && nullcmd)
{
#if defined (HAVE_GETRUSAGE)
#if defined (HAVE_GETRUSAGE) && defined (HAVE_GETTIMEOFDAY)
selfb.ru_utime.tv_sec = kidsb.ru_utime.tv_sec = selfb.ru_stime.tv_sec = kidsb.ru_stime.tv_sec = 0;
selfb.ru_utime.tv_usec = kidsb.ru_utime.tv_usec = selfb.ru_stime.tv_usec = kidsb.ru_stime.tv_usec = 0;
before = shellstart;
#else
#elif defined (HAVE_TIMES)
before.tms_utime = before.tms_stime = before.tms_cutime = before.tms_cstime = 0;
tbefore = shell_start_time * get_clk_tck ();
#endif