From mboxrd@z Thu Jan 1 00:00:00 1970 From: erik quanstrom Date: Sat, 21 May 2016 09:51:08 -0700 To: 9fans@9fans.net Message-ID: <36c146b2e870849515a1677237037219@lilly.quanstro.net> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: Re: [9fans] bug in authdial() Topicbox-Message-UUID: 921aafb2-ead9-11e9-9d60-3106f5b1d025 > static int > reap(Dest *dp) > { > char exitsts[2*ERRMAX]; > + int n; > - if (outstandingprocs(dp) && await(exitsts, sizeof exitsts) >= 0) { > + if (outstandingprocs(dp) && (n = await(exitsts, sizeof exitsts-1)) >= 0) { > + exitsts[n] = 0; > notedeath(dp, exitsts); > return 0; > } > return -1; > } > > probably 2*ERRMAX is enough for await(). > > I wonder why await() returns non-terminated string? > a better solution is to just use waitmsg (see wait(2)). the parsing rules and sizing are already implemented there. - erik