[busybox] BUG with find -exec

Rich Felker dalias at aerifal.cx
Fri Dec 22 21:54:29 PST 2006


On Sat, Dec 23, 2006 at 01:47:00AM +0100, Denis Vlasenko wrote:
> I needed to modify spawn a bit so that errno is retrieved from the vfork'ed child.
> BTW, do you know why we use "_static_ int failed" here?
> I tested and without it, errno isn't returned properly. Why?

Because failed is probably cached in a register and the vforked child
can't modify the parent's registers. :) Try adding volatile instead of
static and see if it works. But keep in mind, vfork might just be
plain fork on some archs, in which case the code won't work anyway
unless you use some other communication method to the parent..

Rich



More information about the busybox mailing list