Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

RE: Modules dependencies RE: PATCH: zftp/tcp abstraction



>
> } One question - I do not quite understand logic in load_module.
> It looks like
> }
> } if module not found
> }   load module
> } load module
> }
> } One of these 'load module' looks redundant?
>
> Look closely at the `if module not found' block.  It's possible that the
> module may be linked but not loaded (no "handle") in that block.  In that
> case a second call to load_module() will find the module, but still needs
> to perform the actual loading.
>

No, I still do not understand it. The "if no found" block is basically just
an abridged version of what happens after. Moreover, remembering what Zefram
said: "Problem is you can't call that function without loading the module,
and you can't successfully load the module until you've got that
information." And look what happens here:

    if (!(node = find_module(name, 1, &name))) {
        if (!(linked = module_linked(name)) &&
            !(handle = do_load_module(name))) {
            unqueue_signals();
            return 0;
        }

i.e. we imediately try to dlopen() a module and in the worst case it
obviously fails because no dependecies were loaded. Something is wrong here.

-andrej



Messages sorted by: Reverse Date, Date, Thread, Author