aboutsummaryrefslogtreecommitdiffstats
path: root/istream.c
diff options
context:
space:
mode:
authorFumitoshi UKAI <ukai@debian.or.jp>2003-01-10 17:06:17 +0000
committerFumitoshi UKAI <ukai@debian.or.jp>2003-01-10 17:06:17 +0000
commitf4d6305bdddca9c1deb51bd19904779cbbf4406b (patch)
tree06f30cd3d18ec1357802f1b836a83007992c3267 /istream.c
parentfix indent (diff)
downloadw3m-f4d6305bdddca9c1deb51bd19904779cbbf4406b.tar.gz
w3m-f4d6305bdddca9c1deb51bd19904779cbbf4406b.zip
[w3m-dev 03632] cleanup (don't close connection of news server)
* file.c (loadSomething): remove UFclose nntp:,news: (loadFile): UFclose (loadGeneralFile): always UFclose * html.h (UFclose): only reset when ISclose ==0 * istream.c (ISclose): return int (ISfileno): flag IST_UNCLOSE * istream.h (ISclose): return int (IST_UNCLOSE): added * news.c (news_close): reset IST_UNCLOSE (news_open): set IST_UNCLOSE From: Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
Diffstat (limited to '')
-rw-r--r--istream.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/istream.c b/istream.c
index 7777bc2..b5e8c8d 100644
--- a/istream.c
+++ b/istream.c
@@ -1,4 +1,4 @@
-/* $Id: istream.c,v 1.17 2003/01/10 16:58:31 ukai Exp $ */
+/* $Id: istream.c,v 1.18 2003/01/10 17:06:23 ukai Exp $ */
#include "fm.h"
#include "myctype.h"
#include "istream.h"
@@ -176,15 +176,17 @@ newEncodedStream(InputStream is, char encoding)
return stream;
}
-void
+int
ISclose(InputStream stream)
{
MySignalHandler(*prevtrap) ();
- if (stream == NULL || stream->base.close == NULL)
- return;
+ if (stream == NULL || stream->base.close == NULL ||
+ stream->base.type & IST_UNCLOSE)
+ return -1;
prevtrap = signal(SIGINT, SIG_IGN);
stream->base.close(stream->base.handle);
signal(SIGINT, prevtrap);
+ return 0;
}
int
@@ -336,7 +338,7 @@ ISfileno(InputStream stream)
{
if (stream == NULL)
return -1;
- switch (IStype(stream)) {
+ switch (IStype(stream) & ~IST_UNCLOSE) {
case IST_BASIC:
return *(int *)stream->base.handle;
case IST_FILE: