lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 18 Dec 2009 22:29:50 +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,
	Frédéric Weisbecker <fweisbec@...il.com>,
	Mike Galbraith <efault@....de>,
	Paul Mackerras <paulus@...ba.org>
Subject: Re: [PATCH 1/1] perf record: We should fork only if a program was
 specified to run

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

--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ