dash.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Herbert Xu <herbert@gondor.apana.org.au>
To: Jonathan Nieder <jrnieder@gmail.com>
Cc: dash@vger.kernel.org, Jilles Tjoelker <jilles@stack.nl>,
	Drake Wilson <drake@begriffli.ch>, Reuben Thomas <rrt@sc3d.org>
Subject: Re: [PATCH 4/4] [MAIN] Optimize dash -c "command" to avoid a fork
Date: Thu, 7 Jul 2011 16:22:53 +0800	[thread overview]
Message-ID: <20110707082253.GA18209@gondor.apana.org.au> (raw)
In-Reply-To: <20110707074856.GC11514@elie>

On Thu, Jul 07, 2011 at 02:48:56AM -0500, Jonathan Nieder wrote:
>
> By the way, is the pungetc() call needed?  I tried to provoke
> misbehavior using here documents and reading from the terminal but
> didn't manage to come up with a relevant scenario.

It's probably not needed.  I didn't touch it in order to minimise
the changes.

> mksyntax #include-s parser.h, so after a "make clean":
> 
> 	gcc -include ../config.h -DBSD=1 -DSHELL -DIFS_BROKEN  -g -Os -Wall -o mksyntax mksyntax.c
> 	In file included from mksyntax.c:43:0:
> 	parser.h:37:19: fatal error: token.h: No such file or directory
> 
> The following (on top) fixes it here.

Oops, does this patch fix it?

diff --git a/src/Makefile.am b/src/Makefile.am
index 05ed70a..a552087 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -12,7 +12,8 @@ AM_CFLAGS_FOR_BUILD = -g -O2 $(COMMON_CFLAGS)
 AM_CPPFLAGS_FOR_BUILD = $(COMMON_CPPFLAGS)
 
 COMPILE_FOR_BUILD = \
-	$(CC_FOR_BUILD) $(AM_CPPFLAGS_FOR_BUILD) $(CPPFLAGS_FOR_BUILD) \
+	$(CC_FOR_BUILD) $(DEFAULT_INCLUDES) $(AM_CPPFLAGS_FOR_BUILD) \
+	$(CPPFLAGS_FOR_BUILD) \
 	$(AM_CFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD) 
 
 bin_PROGRAMS = dash
@@ -31,12 +32,12 @@ dash_SOURCES = \
 	show.h system.h trap.h var.h
 dash_LDADD = builtins.o init.o nodes.o signames.o syntax.o
 
-HELPERS = mkinit mksyntax mknodes mksignames
+HELPERS = mkinit mknodes mksignames
 
 BUILT_SOURCES = builtins.h nodes.h syntax.h token.h token_vars.h
 CLEANFILES = \
 	$(BUILT_SOURCES) $(patsubst %.o,%.c,$(dash_LDADD)) \
-	$(HELPERS) builtins.def
+	$(HELPERS) mksyntax builtins.def
 
 man_MANS = dash.1
 EXTRA_DIST = \
@@ -65,5 +66,8 @@ syntax.c syntax.h: mksyntax
 signames.c: mksignames
 	./$^
 
+mksyntax: mksyntax.c token.h
+	$(COMPILE_FOR_BUILD) -o $@ $<
+
 $(HELPERS): %: %.c
 	$(COMPILE_FOR_BUILD) -o $@ $<

Thanks,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

  reply	other threads:[~2011-07-07  8:22 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-10  7:18 [PATCH/RFC dash 0/4] Avoid a fork before running last command given to -c Jonathan Nieder
2011-04-10  7:21 ` [PATCH 1/4] [INPUT] Introduce preadateof predicate to check for end of input Jonathan Nieder
2011-04-10  7:22 ` [PATCH 2/4] [EVAL] Make eval flags public Jonathan Nieder
2011-04-10  7:35 ` [PATCH 3/4] [EVAL] Take advantage of EV_EXIT in evalstring Jonathan Nieder
2011-04-10  7:36 ` [PATCH 4/4] [MAIN] Optimize dash -c "command" to avoid a fork Jonathan Nieder
2011-07-07  3:48   ` Herbert Xu
2011-07-07  4:27     ` Jonathan Nieder
2011-07-07  4:57       ` Herbert Xu
2011-07-07  5:56         ` Herbert Xu
2011-07-07  7:48           ` Jonathan Nieder
2011-07-07  8:22             ` Herbert Xu [this message]
2011-07-07  8:37               ` Jonathan Nieder
2011-07-07  8:39                 ` Herbert Xu
2011-04-10  7:38 ` [PATCH 5/4] [EVAL] Remove unused EV_BACKCMD flag Jonathan Nieder
2011-07-07  3:56   ` Herbert Xu
2011-04-15 13:07 ` [PATCH/RFC dash 0/4] Avoid a fork before running last command given to -c Herbert Xu
2011-04-17 22:13   ` Jilles Tjoelker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110707082253.GA18209@gondor.apana.org.au \
    --to=herbert@gondor.apana.org.au \
    --cc=dash@vger.kernel.org \
    --cc=drake@begriffli.ch \
    --cc=jilles@stack.nl \
    --cc=jrnieder@gmail.com \
    --cc=rrt@sc3d.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).