From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17195 invoked from network); 28 Sep 2001 11:07:21 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 28 Sep 2001 11:07:21 -0000 Received: (qmail 11865 invoked by alias); 28 Sep 2001 11:07:13 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 15893 Received: (qmail 11851 invoked from network); 28 Sep 2001 11:07:13 -0000 To: zsh-workers@sunsite.dk (Zsh hackers list) Subject: Re: Core dump unloading zsh/zftp In-reply-to: "Borsenkow Andrej"'s message of "Fri, 28 Sep 2001 14:33:14 +0400." <002701c14808$fafda670$21c9ca95@mow.siemens.ru> Date: Fri, 28 Sep 2001 12:06:36 +0100 Message-ID: <25743.1001675196@csr.com> From: Peter Stephenson Borsenkow Andrej wrote: > > + if (!module_loaded("zsh/net/tcp")) > > + return !load_module("zsh/net/tcp"); > > > require_module does a bit more checking and is using > queue/unqueue_signals which makes me suspect it is better suited ... (or > all this checking is redundant?) You're right, that's the obvious thing to use. The third argument to require_module appears not to do anything, however. One very minor issue with loading a module at that point is that it appears after the module you're actually requesting (i.e. zsh/zftp) in the list of modules produced by zmodload, which is slightly illogical. Index: Src/Modules/zftp.c =================================================================== RCS file: /cvsroot/zsh/zsh/Src/Modules/zftp.c,v retrieving revision 1.19 diff -u -r1.19 zftp.c --- Src/Modules/zftp.c 2001/09/08 21:09:56 1.19 +++ Src/Modules/zftp.c 2001/09/28 11:01:45 @@ -3099,7 +3099,8 @@ int setup_(Module m) { - return 0; + /* setup_ returns 0 for success. require_module returns 1 for success. */ + return !require_module("", "zsh/net/tcp", 0, 0); } /**/ -- Peter Stephenson Software Engineer CSR Ltd., Science Park, Milton Road, Cambridge, CB4 0WH, UK Tel: +44 (0)1223 392070 ********************************************************************** The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer. **********************************************************************