about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2002-06-05 21:02:34 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2002-06-05 21:02:34 +0000
commitb2226ac72f5f4c5202f44ff3c35bbf4a864e1ab9 (patch)
treee38c1b66b134a7402c0bbaeadab59811cce5d677
parent682d83503bf54b9bd5f84778efc17f4e5cde350f (diff)
downloadzsh-b2226ac72f5f4c5202f44ff3c35bbf4a864e1ab9.tar.gz
zsh-b2226ac72f5f4c5202f44ff3c35bbf4a864e1ab9.tar.xz
zsh-b2226ac72f5f4c5202f44ff3c35bbf4a864e1ab9.zip
remove builtin when tcp module is unloaded.
-rw-r--r--ChangeLog5
-rw-r--r--Src/Modules/tcp.c4
2 files changed, 6 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 0c48121e5..6c5a52d9e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2002-06-05  Peter Stephenson  <pws@pwstephenson.fsnet.co.uk>
+
+	* 17294: Src/Modules/tcp.c: remove session even if closing fd
+	failed; remove builtin from hash table when unloading module.
+
 2002-06-05  Peter Stephenson  <pws@csr.com>
 
 	* 17292: Src/builtin.c: shut up compiler if no OPEN_MEMSTREAM.
diff --git a/Src/Modules/tcp.c b/Src/Modules/tcp.c
index 25a88ff76..5dc00d0bc 100644
--- a/Src/Modules/tcp.c
+++ b/Src/Modules/tcp.c
@@ -299,10 +299,7 @@ tcp_close(Tcp_session sess)
 	{
 	    err = close(sess->fd);
 	    if (err)
-	    {
 		zwarn("connection close failed: %e", NULL, errno);
-		return -1;
-	    }
 	}
 	zts_delete(sess);
 	return 0;
@@ -701,6 +698,7 @@ int
 cleanup_(Module m)
 {
     tcp_cleanup();
+    deletebuiltins(m->nam, bintab, sizeof(bintab)/sizeof(*bintab));
     freelinklist(ztcp_sessions, (FreeFunc) ztcp_free_session);
     return 0;
 }