diff options
author | Wayne Davison <wayned@users.sourceforge.net> | 2004-10-21 00:33:50 +0000 |
---|---|---|
committer | Wayne Davison <wayned@users.sourceforge.net> | 2004-10-21 00:33:50 +0000 |
commit | 3ccc3e4bdcaed42c72e6b22c1306518458778541 (patch) | |
tree | a420f6a525ed82316b35f9d349c1736d6073251e /Src/exec.c | |
parent | 65729f55704b22dbe781bd826a852bfe48b3e8e1 (diff) | |
download | zsh-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.c | 7 |
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); |