The variable is not used, but as I'm not very familiar with the code and it might be used only for nvlist_get_number function. Better only silence it instead of remove.
Details
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
I also reanalyze the code and if we want to remove nvlist_get_number bather is just to remove the flags variable.
But in other hand we also have zygote_clone function which is prepared to get some flags, so in my opinion we should do one of two things:
1* Remove the flags variable also from zygote_clone function.
2* Leave it as it is, because I think its quite good practice to get all variables which you send. It will be easier then to add some flags if we ever need it in zygote.
I think zygote_clone() is a different case, as it receives flags as a parameter and pass it to nvlist_add_number(), not the same case as zygote_main().
If my understand is correctly its look like:
- zygote_main() is waiting on socket
- zygote_clone() is called somewhere in code and it send nvlist (nvlist_xfer(3) function) over socket to the zygote_main() function
- this nvlist which is sent contains flags, which are get by call you removed (nvlist_get_number(3) in line 147)
- flags in zygote_clone function are always 0
In my opinion if you want to remove flags which are currently unused you should remove them from sender and receiver.
I have update the patch as you mention @oshogbo, I made more tests too and the flags is always 0. However I went through the revision r282346 where did you add flags at nvlist_recv().
So in this case, could you double review this patch?
All the best.
Update the patch again, the last update took things not related with this review. Sorry!