From: Ilya Zakharevich Date: Wed, 7 Feb 1996 17:16:06 +0000 (-0500) Subject: TMPFILE support X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e632a5f6ab0a453792bebdee829ccf5f39056657;p=p5sagit%2Fp5-mst-13.2.git TMPFILE support Currently on DOSISH machines a -e line with a syntax error results in persisting pl234523 tmpfile. The patch below: a) Cleans up the cleanup code; b) Moves the TMPPATH specifics to header files. I do not send patches for OS/2 files, since they are very much reworked now, I only note that b) allows OS/2 startup to specify TMPPATH to look to a $ENV{TMP} directory (instead of the current directory, as it is now). Note that this allows now running -e perl from read-only media. Since there is no place now to have DOSISH _code_, as opposed to _headers_, I leave the TMPPATH code on ./os2/os2.c, though it should be common to DOS as well. Enjoy, Ilya --- diff --git a/dosish.h b/dosish.h index 42fdf3e..a3a4acc 100644 --- a/dosish.h +++ b/dosish.h @@ -2,6 +2,7 @@ #define BIT_BUCKET "/dev/null" /* Will this work? */ #define PERL_SYS_INIT(c,v) +#define TMPPATH "plXXXXXX" /* * fwrite1() should be a routine with the same calling sequence as fwrite(), diff --git a/pp_ctl.c b/pp_ctl.c index 80e55be..7416f0e 100644 --- a/pp_ctl.c +++ b/pp_ctl.c @@ -998,8 +998,12 @@ char *message; } fputs(message, stderr); (void)fflush(stderr); - if (e_fp) + if (e_fp) { +#ifdef DOSISH + fclose(e_fp); +#endif (void)UNLINK(e_tmpname); + } statusvalue = SHIFTSTATUS(statusvalue); #ifdef VMS my_exit((U32)vaxc$errno?vaxc$errno:errno?errno:statusvalue?statusvalue:SS$_ABORT);