[PATCH v2] rmmod.c: update message for ENOENT

Denys Vlasenko vda.linux at googlemail.com
Sat Oct 24 02:23:17 UTC 2015


I removed moderror() instead, its errno translations are for module *loads*,
noty *unloads*.

Please try current git.

On Fri, Oct 23, 2015 at 5:35 PM, Maxin B. John <maxin.john at intel.com> wrote:
> When we try to remove a non-existing module:
>
> $ rmmod nonexisting
> rmmod: can't unload 'nonexisting': unknown symbol in module, or unknown
> parameter
>
> man page of "delete_module" says:
> ENOENT: No module by that name exists.
>
> Update the inconsistent message.
>
> Signed-off-by: Maxin B. John <maxin.john at intel.com>
> ---
>  modutils/rmmod.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/modutils/rmmod.c b/modutils/rmmod.c
> index f13ff9e..f5f68cf 100644
> --- a/modutils/rmmod.c
> +++ b/modutils/rmmod.c
> @@ -59,7 +59,11 @@ int rmmod_main(int argc UNUSED_PARAM, char **argv)
>                 else
>                         filename2modname(bname, modname);
>                 if (bb_delete_module(modname, flags))
> -                       bb_error_msg_and_die("can't unload '%s': %s",
> +                       if (errno == ENOENT)
> +                bb_error_msg_and_die("can't unload '%s': it is not loaded now",
> +                    modname);
> +            else
> +                bb_error_msg_and_die("can't unload '%s': %s",
>                                         modname, moderror(errno));
>         }
>
> --
> 2.4.0
>
> _______________________________________________
> busybox mailing list
> busybox at busybox.net
> http://lists.busybox.net/mailman/listinfo/busybox


More information about the busybox mailing list