diff options
author | Andy Dougherty <doughera@lafayette.edu> | 1998-03-09 10:23:33 -0500 |
---|---|---|
committer | Malcolm Beattie <mbeattie@sable.ox.ac.uk> | 1998-03-16 12:55:39 +0000 |
commit | e5c9fcd0420f2862565625a4bd5596204107f54f (patch) | |
tree | 6802f821b6b73f8fd7d5217e52348bd0ea711675 /perl.c | |
parent | 9e48b294a088693583142bb2058db509a62bb303 (diff) | |
download | perl-e5c9fcd0420f2862565625a4bd5596204107f54f.tar.gz |
[PATCH 5.004_62} Config_62-01 patch available.
Date: Mon, 9 Mar 1998 15:23:33 -0500 (EST)
Subject: [PATCH 5.004_62] Tiny hint file updates
Date: Mon, 9 Mar 1998 13:21:46 -0500 (EST)
p4raw-id: //depot/perl@812
Diffstat (limited to 'perl.c')
-rw-r--r-- | perl.c | 16 |
1 files changed, 13 insertions, 3 deletions
@@ -559,6 +559,7 @@ perl_parse(PerlInterpreter *sv_interp, void (*xsinit) (void), int argc, char **a char *validarg = ""; I32 oldscope; AV* comppadlist; + int e_tmpfd = -1; dJMPENV; int ret; @@ -679,12 +680,20 @@ setuid perl scripts securely.\n"); croak("No -e allowed in setuid scripts"); if (!e_fp) { e_tmpname = savepv(TMPPATH); +#ifdef HAS_MKSTEMP + e_tmpfd = PerlLIO_mkstemp(e_tmpname); + + if (e_tmpfd < 0) + croak("Can't mkstemp() temporary file \"%s\"", e_tmpname); + e_fp = PerlIO_fdopen(e_tmpfd,"w"); +#else /* use mktemp() */ (void)PerlLIO_mktemp(e_tmpname); if (!*e_tmpname) - croak("Can't mktemp()"); + croak("Can't mktemp() temporary file \"%s\"", e_tmpname); e_fp = PerlIO_open(e_tmpname,"w"); - if (!e_fp) - croak("Cannot open temporary file"); +#endif /* HAS_MKSTEMP */ + if (!e_fp) + croak("Cannot open temporary file \"%s\"", e_tmpname); } if (*++s) PerlIO_puts(e_fp,s); @@ -916,6 +925,7 @@ print \" \\@INC:\\n @INC\\n\";"); (void)UNLINK(e_tmpname); Safefree(e_tmpname); e_tmpname = Nullch; + e_tmpfd = -1; } /* now that script is parsed, we can modify record separator */ |