tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: options MODULAR improvements phase 0.5



On Fri, May 22, 2009 at 05:33:46PM -0700, John Nemeth wrote:

> @@ -558,7 +559,7 @@
>         const int maxdepth = 6;
>         modinfo_t *mi;
>         module_t *mod, *mod2;
> -       char buf[MAXMODNAME];
> +       char buf[MAXMODNAME], *path = NULL;

KNF says to initialize automatic variables seperately, not where they are
declared/defined.

> @@ -616,11 +617,21 @@
>                         depth--;
>                         return ENOMEM;
>                 }
> -               error = kobj_load_file(&mod->mod_kobj, name, module_base,
> -                   autoload);
> +               path = PNBUF_GET();
> +               if (!autoload) {
> +                       snprintf(path, MAXPATHLEN - 1, "%s", name);

I think this is equivalent to strlcpy(), which of course would take
MAXPATHLEN not MAXPATHLEN - 1.

> +kobj_load_file(kobj_t *kop, const char *path, const uint32_t flags)

The flags value is an int, IIRC.


Home | Main Index | Thread Index | Old Index