[PATCH 3/3] modprobe-small: define and use DEPMOD_OPT_n (option mask)

Kang-Che Sung explorer09 at gmail.com
Fri Feb 10 13:30:35 UTC 2017


On Fri, Feb 10, 2017 at 9:09 PM, Xabier Oneca  --  xOneca
<xoneca at gmail.com> wrote:
> Hello,
>
> 2017-02-09 15:48 GMT+01:00 Kang-Che Sung <explorer09 at gmail.com>:
>> Signed-off-by: Kang-Che Sung <explorer09 at gmail.com>
>> ---
>>  modutils/modprobe-small.c | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/modutils/modprobe-small.c b/modutils/modprobe-small.c
>> index 52765bc99..43625490b 100644
>> --- a/modutils/modprobe-small.c
>> +++ b/modutils/modprobe-small.c
>> @@ -79,6 +79,7 @@ int lsmod_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
>>  #define is_rmmod    (ENABLE_RMMOD    && (ONLY_APPLET || applet_name[0] == 'r'))
>>
>>  enum {
>> +       DEPMOD_OPT_n = (1 << 0), /* dry-run, print to stdout */
>
> Why not call it OPT_n? Is it used somewere else?
>

I have considered using OPT_n before, but I also think about the '-n'
option being implemented for modprobe/insmod/rmmod in the future,
and that way the option bits will conflict. (At least I tried to hack the
code to implement '-n'. It's --dry-run, so implement it won't be difficult,
although the code won't be neat.)

depmod doesn't use the same getopt32 call as modprobe/insmod/
rmmod's call. So it's better for the OPT constants be separate as well.


More information about the busybox mailing list