Gentoo Archives: gentoo-portage-dev

From: Mike Frysinger <vapier@g.o>
To: gentoo-portage-dev@l.g.o
Subject: Re: [gentoo-portage-dev] [RFC/PATCH] prepstrip/ecompressdir: parallelize operations
Date: Mon, 14 May 2012 18:14:26
Message-Id: 201205141333.16163.vapier@gentoo.org
In Reply to: Re: [gentoo-portage-dev] [RFC/PATCH] prepstrip/ecompressdir: parallelize operations by Michael Haubenwallner
1 On Monday 14 May 2012 03:33:58 Michael Haubenwallner wrote:
2 > On 05/11/2012 06:39 PM, Mike Frysinger wrote:
3 > > +multijob_child_init() {
4 > > + trap 'echo ${BASHPID} $? >&'${mj_control_fd} EXIT
5 > > + trap 'exit 1' INT TERM
6 > > +}
7 >
8 > Just wondering why $! in parent isn't used anywhere, even not for some
9 > integrity check if the child's BASHPID actually was forked by parent.
10
11 i don't know of any cases where this would error out. if there are too many
12 processes, bash itself will retry a few times before aborting. so checking $!
13 wouldn't help.
14
15 keep in mind, what you're proposing is basically checking the return value of
16 fork(), and that can fail in very few ways. all of which, afaik, bash does
17 not bubble up to the script.
18 -mike

Attachments

File name MIME type
signature.asc application/pgp-signature