[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1261259944.4314.1.camel@laptop>
Date: Sat, 19 Dec 2009 22:59:04 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Arnaldo Carvalho de Melo <acme@...radead.org>
Cc: Ingo Molnar <mingo@...e.hu>, linux-kernel@...r.kernel.org,
Arnaldo Carvalho de Melo <acme@...hat.com>,
Frédéric Weisbecker <fweisbec@...il.com>,
Mike Galbraith <efault@....de>,
Paul Mackerras <paulus@...ba.org>
Subject: Re: [PATCH 1/1 v2] perf record: We should fork only if a program
was specified to run
On Sat, 2009-12-19 at 19:22 -0200, Arnaldo Carvalho de Melo wrote:
> @@ -422,7 +423,7 @@ static int __cmd_record(int argc __used, const char **argv)
> signal(SIGCHLD, sig_handler);
> signal(SIGINT, sig_handler);
>
> - if (pipe(child_ready_pipe) < 0 || pipe(go_pipe) < 0) {
> + if (forks && (pipe(child_ready_pipe) < 0 || pipe(go_pipe) < 0)) {
> perror("failed to create pipes");
> exit(-1);
> }
you can avoid this by simply putting the whole thing into the if (forks)
thing below.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists