lkml.org 
[lkml]   [2009]   [Dec]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 1/1 v2] perf record: We should fork only if a program was specified to run
From
Date
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.



\
 
 \ /
  Last update: 2009-12-19 23:01    [W:0.023 / U:0.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site