From 7bf6f44ea22e3689932e71ea44209acc24cc2282 Mon Sep 17 00:00:00 2001 From: jmarcus Date: Wed, 19 Feb 2003 18:59:52 +0000 Subject: [PATCH] Revert previous mkstemp() commit. While it quieted the compiler, it changed the essence of functionality, and broke rename. Pointed out by: didier --- etc/afpd/file.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/etc/afpd/file.c b/etc/afpd/file.c index f8c42ded..b395d8b3 100644 --- a/etc/afpd/file.c +++ b/etc/afpd/file.c @@ -1,5 +1,5 @@ /* - * $Id: file.c,v 1.85 2003-02-17 02:12:04 jmarcus Exp $ + * $Id: file.c,v 1.86 2003-02-19 18:59:52 jmarcus Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -1687,7 +1687,6 @@ int ibuflen, *rbuflen; struct ofork *s_of; struct ofork *d_of; int crossdev; - int tmpfd; #ifdef CNID_DB int slen, dlen; @@ -1822,9 +1821,8 @@ int ibuflen, *rbuflen; * NOTE: the temp file will be in the dest file's directory. it * will also be inaccessible from AFP. */ memcpy(temp, APPLETEMP, sizeof(APPLETEMP)); - if ((tmpfd = mkstemp(temp)) == -1) + if (!mktemp(temp)) return AFPERR_MISC; - close(tmpfd); /* now, quickly rename the file. we error if we can't. */ if ((err = renamefile(p, temp, temp, vol_noadouble(vol), adsp)) < 0) -- 2.39.2