summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlya Zakharevich <ilya@math.ohio-state.edu>1996-02-07 12:16:06 -0500
committerAndy Dougherty <doughera@lafcol.lafayette.edu>1996-02-07 12:16:06 -0500
commite632a5f6ab0a453792bebdee829ccf5f39056657 (patch)
treec15673424ed7f338a9901514e26f4d04ef8e8764
parent1193dd27ade65d48ff9917d545f844f2c8e15493 (diff)
downloadperl-e632a5f6ab0a453792bebdee829ccf5f39056657.tar.gz
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
-rw-r--r--dosish.h1
-rw-r--r--pp_ctl.c6
2 files changed, 6 insertions, 1 deletions
diff --git a/dosish.h b/dosish.h
index 42fdf3ec3c..a3a4acc126 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 80e55beb31..7416f0e3e2 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);