You can take a look at lib/kobject.c:kset_hotplug()
> You're just setting first element of provided environment to
> "FIRMWARE=%s", possibly overwriting the existing value.
envp points to the first empty slot of the environment being
constructed, so no, I am not overwriting anything.
> Then why are you incrementing `i'? Why are you using `i' at all? Why
> are you incrementing `scratch'?
The code is ready to add a new environment variable if needed. If we
really don't need more variables, it could be simplified, but I don't
think it is so important.
> Ah, it seems like you should be using num_envp somehow, and you're not.
OK, I just added:
if (num_envp < 1)
return -ENOMEM;
> Also, environment pointer list must be terminated with a NULL pointer. Is
> it not done or is that handled somewhere else?
The envp array we get is reset to zero, so anything we don't explicitly
set is already NULL.
> The machine I have 2.5.69 sources is not reachable now so I cannot
> check it. Sorry if I am wrong.
The num_envp issue was real, and anyway, I appreciate a little
feedback, it seams like people don't hack the kernel on Sunday :-P
Thanks
Manuel
--
--- Manuel Estrada Sainz <ranty@debian.org>
<ranty@bigfoot.com>
<ranty@users.sourceforge.net>
------------------------ <manuel.estrada@hispalinux.es> -------------------
Let us have the serenity to accept the things we cannot change, courage to
change the things we can, and wisdom to know the difference.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/