From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1070 invoked from network); 14 Jun 2001 09:33:52 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 14 Jun 2001 09:33:52 -0000 Received: (qmail 2026 invoked by alias); 14 Jun 2001 09:33:23 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 14914 Received: (qmail 2015 invoked from network); 14 Jun 2001 09:33:22 -0000 X-Envelope-Sender-Is: Andrej.Borsenkow@mow.siemens.ru (at relayer goliath.siemens.de) From: "Andrej Borsenkow" To: Subject: RE: Modules dependencies RE: PATCH: zftp/tcp abstraction Date: Thu, 14 Jun 2001 13:33:41 +0400 Message-ID: <000901c0f4b5$1958ecd0$21c9ca95@mow.siemens.ru> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) In-Reply-To: <1010607153157.ZM7731@candle.brasslantern.com> X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Importance: Normal > > } 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