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: Fri, 11 May 2012 21:07:34
Message-Id: 201205111414.14141.vapier@gentoo.org
In Reply to: Re: [gentoo-portage-dev] [RFC/PATCH] prepstrip/ecompressdir: parallelize operations by Zac Medico
1 On Friday 11 May 2012 13:32:46 Zac Medico wrote:
2 > On 05/11/2012 09:39 AM, Mike Frysinger wrote:
3 > > +multijob_finish() {
4 > > + local ret=0
5 > > + while [[ ${mj_num_jobs} -gt 0 ]] ; do
6 > > + multijob_finish_one
7 > > + : $(( ret += $? ))
8 > > + done
9 > > + # Let bash clean up its internal child tracking state.
10 > > + wait
11 > > + return ${ret}
12 > > +}
13 >
14 > Wouldn't it be better to use $(( ret |= $? )) there, in order to avoid a
15 > possible integer overflow? Other than that, the patch looks good to me.
16
17 i meant to use |= like the other places ...
18
19 not that i'm too worried about overflow here as the exit value is clamped to
20 [0..255], so it'd take millions of failing processes to cause a problem :).
21 -mike

Attachments

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