1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-11-01 18:30:55 +01:00

Use the new gettempfile() function.

This commit is contained in:
Wayne Davison 2004-10-21 00:33:50 +00:00
parent 65729f5570
commit 3ccc3e4bdc
4 changed files with 9 additions and 16 deletions

View file

@ -1971,8 +1971,7 @@ zftp_open(char *name, char **args, int flags)
* However, it is closed whenever there are no connections open.
*/
if (zfstatfd == -1) {
fname = gettempname(NULL, 1);
zfstatfd = open(fname, O_RDWR|O_CREAT|O_EXCL, 0600);
zfstatfd = gettempfile(NULL, 1, &fname);
DPUTS(zfstatfd == -1, "zfstatfd not created");
#if defined(F_SETFD) && defined(FD_CLOEXEC)
/* If the shell execs a program, we don't want this fd left open. */