[w3m-dev 03629] delete tmp file

* etc.c (tempfname): always file to delete
* file.c (xface2xpm): no need fileToDelete
	(readHeader): ditto
	(loadGeneralFile): ditto
	(loadHTMLBuffer): ditto
	(loadHTMLString): ditto
	(loadGopherDir): ditto
	(loadImageBuffer): ditto
	(doExternal): rewrite
	(doFileSave): no need fileToDelete
	(uncompress_stream): ditto
* fm.h (CurrentPid): added
* image.c (getImage): cache->touch to delete
* local.c (setLocalCookie): use CurrentPid
	(localcgi_post): fileToDelete
* main.c (main): CurrentPid
	(pipeBuf): no need fileToDelete
	(query_from_followform): CurrentPid
	(vmSrc): no need fileToDelete
From: Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
This commit is contained in:
Fumitoshi UKAI
2003-01-10 16:42:14 +00:00
parent 03cccce553
commit 66d04cc161
7 changed files with 42 additions and 45 deletions

10
etc.c
View File

@@ -1,4 +1,4 @@
/* $Id: etc.c,v 1.46 2002/12/27 16:09:18 ukai Exp $ */
/* $Id: etc.c,v 1.47 2003/01/10 16:42:26 ukai Exp $ */
#include "fm.h"
#include <pwd.h>
#include "myctype.h"
@@ -7,11 +7,6 @@
#include "hash.h"
#include "terms.h"
#ifdef HAVE_GETCWD /* ??? ukai */
#include <unistd.h>
#include <sys/param.h>
#endif /* HAVE_GETCWD */
#include <sys/types.h>
#include <time.h>
#if defined(HAVE_WAITPID) || defined(HAVE_WAIT3)
@@ -1517,7 +1512,8 @@ tmpfname(int type, char *ext)
tmpf = Sprintf("%s/w3m%s%d-%d%s",
rc_dir,
tmpf_base[type],
(int)getpid(), tmpf_seq[type]++, (ext) ? ext : "");
CurrentPid, tmpf_seq[type]++, (ext) ? ext : "");
pushText(fileToDelete, tmpf->ptr);
return tmpf;
}