summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorjilles <jilles@FreeBSD.org>2011-06-16 21:50:28 +0000
committerjilles <jilles@FreeBSD.org>2011-06-16 21:50:28 +0000
commit00d33feb9db18288f251841bbebdf3b74f4d875e (patch)
tree294e1c4d6e3e5c1512b2ca2ccbd4ef4b71e3362f /tools
parentb127ed6f91700e786b6d214b85775e125cb5688b (diff)
downloadFreeBSD-src-00d33feb9db18288f251841bbebdf3b74f4d875e.zip
FreeBSD-src-00d33feb9db18288f251841bbebdf3b74f4d875e.tar.gz
sh: Reduce unnecessary forks with eval.
The eval special builtin now runs the code with EV_EXIT if it was run with EV_EXIT itself. In particular, this eliminates one fork when a command substitution contains an eval command that ends with an external program or a subshell. This is similar to what r220978 did for functions.
Diffstat (limited to 'tools')
-rw-r--r--tools/regression/bin/sh/expansion/cmdsubst11.05
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/regression/bin/sh/expansion/cmdsubst11.0 b/tools/regression/bin/sh/expansion/cmdsubst11.0
new file mode 100644
index 0000000..f1af547
--- /dev/null
+++ b/tools/regression/bin/sh/expansion/cmdsubst11.0
@@ -0,0 +1,5 @@
+# $FreeBSD$
+
+# Not required by POSIX but useful for efficiency.
+
+[ $$ = $(eval '${SH} -c echo\ \$PPID') ]
OpenPOWER on IntegriCloud