From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9074 invoked from network); 28 Sep 2001 10:23:30 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 28 Sep 2001 10:23:30 -0000 Received: (qmail 27924 invoked by alias); 28 Sep 2001 10:23:22 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 15891 Received: (qmail 27906 invoked from network); 28 Sep 2001 10:23:18 -0000 To: zsh-workers@sunsite.dk (Zsh hackers list) Subject: Re: Core dump unloading zsh/zftp In-reply-to: "Bart Schaefer"'s message of "Fri, 28 Sep 2001 10:04:05 -0000." <1010928100405.ZM16401@candle.brasslantern.com> Date: Fri, 28 Sep 2001 11:22:41 +0100 Message-ID: <22087.1001672561@csr.com> From: Peter Stephenson Bart Schaefer wrote: > Running: > zmodload zsh/zftp > zmodload -u zsh/zftp It crashes when you exit the shell, too, if you have zsh/zftp loaded. > It appears that the zfsessions linklist is not empty, even though there > is no valid session in it anywhere. See boot_ -- you always get a `default' session. It way well be related to the stuff I posted yesterday about TCP session management: deciding what zfclose() should actually be doing was one of the big problems. The interface between the zftp and tcp modules is still a bit tricky. Here's the patch to make zftp load tcp. This handles the dependency transparently with a working RTLD_LAZY, which seems fine with Solaris. It should be pretty easy to convert dependency lists into code like this. The only fly in the ointment I can see is with multiple dependencies: if we load module A, then fail to load module B, we should unload A if it wasn't already loaded. Hence we should probably write a function for module.c which is passed the list of dependency modules and handles loading in this way. It doesn't unload tcp automatically, though. I don't know how to do that, given that tcp may meanwhile be used for other things meanwhile. In particular, it links in a builtin, at which point we can't really tell who's doing what. 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 10:12:39 @@ -3099,6 +3099,10 @@ int setup_(Module m) { + /* setup_ returns 0 for success. load_module returns 1 for success. */ + if (!module_loaded("zsh/net/tcp")) + return !load_module("zsh/net/tcp"); + return 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. **********************************************************************