bash: Patch for incorrect feature checks in execute-cmd.c

This commit is contained in:
Jeremy Soller 2018-11-17 07:38:22 -07:00
parent 3f60f5686d
commit 8eb4609469
No known key found for this signature in database
GPG Key ID: E988B49EE78A7FB1

View File

@ -0,0 +1,21 @@
--- source/execute_cmd.c 2016-08-26 05:10:08.000000000 -0600
+++ source-new/execute_cmd.c 2018-11-17 07:32:59.626764573 -0700
@@ -1335,15 +1335,17 @@
nullcmd = (command == 0) || (command->type == cm_simple && command->value.Simple->words == 0 && command->value.Simple->redirects == 0);
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.tv_sec = shell_start_time;
before.tv_usec = 0;
#else
+# if defined (HAVE_TIMES)
before.tms_utime = before.tms_stime = before.tms_cutime = before.tms_cstime = 0;
tbefore = shell_start_time;
#endif
+#endif
}
old_flags = command->flags;