about summary refs log tree commit diff
path: root/Src/exec.c
diff options
context:
space:
mode:
authorWayne Davison <wayned@users.sourceforge.net>2004-10-21 00:33:50 +0000
committerWayne Davison <wayned@users.sourceforge.net>2004-10-21 00:33:50 +0000
commit3ccc3e4bdcaed42c72e6b22c1306518458778541 (patch)
treea420f6a525ed82316b35f9d349c1736d6073251e /Src/exec.c
parent65729f55704b22dbe781bd826a852bfe48b3e8e1 (diff)
downloadzsh-3ccc3e4bdcaed42c72e6b22c1306518458778541.tar.gz
zsh-3ccc3e4bdcaed42c72e6b22c1306518458778541.tar.xz
zsh-3ccc3e4bdcaed42c72e6b22c1306518458778541.zip
Use the new gettempfile() function.
Diffstat (limited to 'Src/exec.c')
-rw-r--r--Src/exec.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/Src/exec.c b/Src/exec.c
index ba4e3d28e..cdde2df25 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -2801,8 +2801,7 @@ getherestr(struct redir *fn)
     untokenize(t);
     unmetafy(t, &len);
     t[len++] = '\n';
-    s = gettempname(NULL, 1);
-    if (!s || (fd = open(s, O_CREAT|O_WRONLY|O_EXCL|O_NOCTTY, 0600)) == -1)
+    if ((fd = gettempfile(NULL, 1, &s)) < 0)
 	return -1;
     write(fd, t, len);
     close(fd);
@@ -2975,11 +2974,9 @@ getoutputfile(char *cmd)
 	return NULL;
     if (!(prog = parsecmd(cmd)))
 	return NULL;
-    if (!(nam = gettempname(NULL, 1)))
+    if (!(nam = gettempname(NULL, 0)))
 	return NULL;
 
-    nam = ztrdup(nam);
-
     if (!jobtab[thisjob].filelist)
 	jobtab[thisjob].filelist = znewlinklist();
     zaddlinknode(jobtab[thisjob].filelist, nam);