From 3ccc3e4bdcaed42c72e6b22c1306518458778541 Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Thu, 21 Oct 2004 00:33:50 +0000 Subject: Use the new gettempfile() function. --- Src/exec.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'Src/exec.c') 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); -- cgit 1.4.1