[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 23/24] libxl: child processes cleanups



On Tue, 2012-04-24 at 16:22 +0100, Ian Jackson wrote:
> Ian Campbell writes ("Re: [Xen-devel] [PATCH 23/24] libxl: child processes 
> cleanups"):
> > On Mon, 2012-04-16 at 18:18 +0100, Ian Jackson wrote:
> > > -    child = fork();
> > > +    pid_t (*fork_replacement)(void*) =
> > > +        CTX->childproc_hooks
> > > +        ? CTX->childproc_hooks->fork_replacement
> > > +        : 0;
> > > +    child =
> > > +        fork_replacement
> > > +        ? fork_replacement(CTX->childproc_user)
> > > +        : fork();
> > 
> > A helper function or macro would be useful here?
> 
> There is exactly one call site for this, since no-one else in libxl is
> allowed to call fork (except libxl__spawn_*, in the child as
> previously discussed, and there it doesn't want to use the hook).

> If you think it would be clearer I'm happy to make it into a
> sub-function.  But IMO libxl__ev_child_fork is already quite short so
> I don't see much point further splitting it up.

I guess I was just a bit slow on the parse of these two statements which
made me think a function might have a name which helped me, but your
explanation about it being the only possible callsite makes sense so I
think you can leave it as is.

Ian.


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.