projects
/
platform
/
upstream
/
perl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8a06405
)
perlio.c, PerlIO_tmpfile: Fall back to cwd if we have no /tmp or $TMPDIR
author
Brian Fraser
<fraserbn@gmail.com>
Wed, 22 Jan 2014 01:45:17 +0000
(22:45 -0300)
committer
Brian Fraser
<fraserbn@gmail.com>
Wed, 22 Jan 2014 01:45:17 +0000
(22:45 -0300)
With this, open($fh, undef) will now work on systems without
a /tmp (or equivalent) where TMPDIR is not set.
perlio.c
patch
|
blob
|
history
diff --git
a/perlio.c
b/perlio.c
index
5d41e76
..
ec19bfe
100644
(file)
--- a/
perlio.c
+++ b/
perlio.c
@@
-4971,6
+4971,12
@@
PerlIO_tmpfile(void)
/* else we try /tmp */
fd = mkstemp(tempname);
}
+ if (fd < 0) {
+ /* Try cwd */
+ sv = newSVpvs(".");
+ sv_catpv(sv, tempname + 4);
+ fd = mkstemp(SvPVX(sv));
+ }
if (fd >= 0) {
f = PerlIO_fdopen(fd, "w+");
if (f)