artulab
projects
/
openbsd
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b32aa91
)
there's no need to fork/exec to execute comments
author
espie
<espie@openbsd.org>
Sun, 9 Jul 2017 15:28:00 +0000
(15:28 +0000)
committer
espie
<espie@openbsd.org>
Sun, 9 Jul 2017 15:28:00 +0000
(15:28 +0000)
okay millert@
usr.bin/make/engine.c
patch
|
blob
|
history
diff --git
a/usr.bin/make/engine.c
b/usr.bin/make/engine.c
index
f6684cf
..
2b1437c
100644
(file)
--- a/
usr.bin/make/engine.c
+++ b/
usr.bin/make/engine.c
@@
-1,4
+1,4
@@
-/* $OpenBSD: engine.c,v 1.5
2 2017/01/29 10:04:13
espie Exp $ */
+/* $OpenBSD: engine.c,v 1.5
3 2017/07/09 15:28:00
espie Exp $ */
/*
* Copyright (c) 2012 Marc Espie.
*
@@
-784,6
+784,10
@@
do_run_command(Job *job)
/* always flush for other stuff */
fflush(stdout);
+ /* Optimization: bypass comments entirely */
+ if (*cmd == '#')
+ return false;
+
/* Fork and execute the single command. If the fork fails, we abort. */
switch (cpid = fork()) {
case -1: