[LEDE-DEV] [PATCH ubox] kmodloader: modprobe: return 0 for loaded modules

yanosz lede at yanosz.net
Fri Mar 3 02:03:07 PST 2017


Hei,

Am 03/03/2017 um 03:32 AM schrieb Yousong Zhou:
> This is the default behaviour with modprobe from kmod package [1] unless
> it is explicitly told that the module is to be loaded for --first-time
> 
>  [1] http://www.kernel.org/pub/linux/utils/kernel/kmod/
> 
> Fixes FS#433
> 
> Signed-off-by: Yousong Zhou <yszhou4tech at gmail.com>
> ---
>  kmodloader.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/kmodloader.c b/kmodloader.c
> index 892ddd8..ed8f833 100644
> --- a/kmodloader.c
> +++ b/kmodloader.c
> @@ -837,7 +837,7 @@ static int main_modprobe(int argc, char **argv)
>  	if (m && m->state == LOADED) {
>  		if (!quiet)
>  			ULOG_ERR("%s is already loaded\n", name);
> -		return -1;
> +		return 0;
>  	} else if (!m) {
>  		if (!quiet)
>  			ULOG_ERR("failed to find a module named %s\n", name);

Thanks for picking this up.

What about returning 1 in the "} else if (!m) {" case, this is
mobprobe's behaviour, afaik.

Greetz, yanosz


-- 
For those of you without hope, we have rooms with color TV,
cable and air conditioning



More information about the Lede-dev mailing list