[OpenWrt-Devel] [PATCH procd 2/4] ujail: remove useless arg in clone call

John Crispin blogic at openwrt.org
Mon Nov 23 03:11:49 EST 2015



On 23/11/2015 09:09, Etienne Champetier wrote:
> Hi,
> 
> Le 23 nov. 2015 08:18, "John Crispin" <blogic at openwrt.org
> <mailto:blogic at openwrt.org>> a écrit :
>>
>>
>>
>> On 23/11/2015 01:39, Etienne CHAMPETIER wrote:
>> > spawn_jail(void) produce a compilation error,
>> > so we use spawn_jail()
>> >
>> > Signed-off-by: Etienne CHAMPETIER <champetier.etienne at gmail.com
> <mailto:champetier.etienne at gmail.com>>
>> > ---
>> >  jail/jail.c | 4 ++--
>> >  1 file changed, 2 insertions(+), 2 deletions(-)
>> >
>> > diff --git a/jail/jail.c b/jail/jail.c
>> > index 56dc9ca..08babde 100644
>> > --- a/jail/jail.c
>> > +++ b/jail/jail.c
>> > @@ -272,7 +272,7 @@ static int exec_jail()
>> >       exit(EXIT_FAILURE);
>> >  }
>> >
>> > -static int spawn_jail(void *arg)
>> > +static int spawn_jail()
>>
>> Hi,
>>
>> this is still wrong. also you might want to write a sentence why it is
>> useless.
>>
> 
> Well, we don't use it, and passing arg to not use it really doesn't
> improve readability.
> 
> I know it break your code style, but it seems we can't have both here :(
> 
> Etienne
> 
>>         John


i wont merge it until there is a (void). it is valid code. try it and
you will see that i am right.



>>
>> >  {
>> >       if (opts.name <http://opts.name> && sethostname(opts.name
> <http://opts.name>, strlen(opts.name <http://opts.name>))) {
>> >               ERROR("failed to sethostname: %s\n", strerror(errno));
>> > @@ -424,7 +424,7 @@ int main(int argc, char **argv)
>> >       if (opts.namespace) {
>> >               jail_process.pid = clone(spawn_jail,
>> >                       child_stack + STACK_SIZE,
>> > -                     CLONE_NEWUTS | CLONE_NEWPID | CLONE_NEWNS |
> CLONE_NEWIPC | SIGCHLD, argv);
>> > +                     CLONE_NEWUTS | CLONE_NEWPID | CLONE_NEWNS |
> CLONE_NEWIPC | SIGCHLD, NULL);
>> >       } else {
>> >               jail_process.pid = fork();
>> >       }
>> >
> 
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list