From: Peter Zijlstra <peterz@infradead.org>
To: Arnaldo Carvalho de Melo <acme@infradead.org>
Cc: "Ingo Molnar" <mingo@elte.hu>,
linux-kernel@vger.kernel.org,
"Frédéric Weisbecker" <fweisbec@gmail.com>,
"Mike Galbraith" <efault@gmx.de>,
"Paul Mackerras" <paulus@samba.org>
Subject: Re: [PATCH 1/1] perf record: We should fork only if a program was specified to run
Date: Fri, 18 Dec 2009 22:29:50 +0100 [thread overview]
Message-ID: <1261171790.20899.675.camel@laptop> (raw)
In-Reply-To: <20091218205853.GD19708@ghostprotocols.net>
On Fri, 2009-12-18 at 18:58 -0200, Arnaldo Carvalho de Melo wrote:
> > > - if (pipe(child_ready_pipe) < 0 || pipe(go_pipe) < 0) {
> > > + if (target_pid == -1 && argc > 0 &&
> > > + (pipe(child_ready_pipe) < 0 || pipe(go_pipe) < 0)) {
> > > perror("failed to create pipes");
> > > exit(-1);
> > > }
Also, there's an unconditional close() a bit further down.
If not for that, I'd have put the whole mkpipe thing in the if
(target_pid == -1) branch.
Maybe I shouldn't have skimped on the extra state for that close
next prev parent reply other threads:[~2009-12-18 21:30 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-18 20:42 [PATCH 1/1] perf record: We should fork only if a program was specified to run Arnaldo Carvalho de Melo
2009-12-18 20:52 ` Peter Zijlstra
2009-12-18 20:58 ` Arnaldo Carvalho de Melo
2009-12-18 21:13 ` Peter Zijlstra
2009-12-18 22:03 ` Ingo Molnar
2009-12-18 21:29 ` Peter Zijlstra [this message]
2009-12-20 10:31 ` Xiao Guangrong
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=1261171790.20899.675.camel@laptop \
--to=peterz@infradead.org \
--cc=acme@infradead.org \
--cc=efault@gmx.de \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=paulus@samba.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