]> arthur.barton.de Git - netatalk.git/commitdiff
Revert previous mkstemp() commit. While it quieted the compiler, it
authorjmarcus <jmarcus>
Wed, 19 Feb 2003 18:59:52 +0000 (18:59 +0000)
committerjmarcus <jmarcus>
Wed, 19 Feb 2003 18:59:52 +0000 (18:59 +0000)
changed the essence of functionality, and broke rename.

Pointed out by: didier <dgautheron@magic.fr>

etc/afpd/file.c

index f8c42ded54f2fb0a6a836ec7402aedf0c6597c98..b395d8b347d819a6edd980939a22f7e9dc075fa5 100644 (file)
@@ -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)