[xiph-cvs] r6625 - icecast/trunk/icecast/src

msmith at xiph.org msmith at xiph.org
Tue May 4 22:05:06 PDT 2004



Author: msmith
Date: 2004-05-05 01:05:05 -0400 (Wed, 05 May 2004)
New Revision: 6625

Modified:
   icecast/trunk/icecast/src/auth.c
Log:
Use remove() then rename() only on win32 - where it's required.
Don't use it on unix systems, which don't need it, and where doing 
_only_ rename() preserves atomicity. 

<p>Modified: icecast/trunk/icecast/src/auth.c
===================================================================
--- icecast/trunk/icecast/src/auth.c	2004-05-04 18:51:34 UTC (rev 6624)
+++ icecast/trunk/icecast/src/auth.c	2004-05-05 05:05:05 UTC (rev 6625)
@@ -366,6 +366,7 @@
     fclose(passwdfile);
 
     /* Now move the contents of the tmp file to the original */
+#ifdef _WIN32
     /* Windows won't let us rename a file if the destination file
        exists...so, lets remove the original first */
     if (remove(state->filename) != 0) {
@@ -373,11 +374,14 @@
                 tmpfile, state->filename, strerror(errno));
     }
     else {
+#endif
         if (rename(tmpfile, state->filename) != 0) {
             ERROR3("Problem moving temp authentication file to original \"%s\" - \"%s\": %s", 
                 tmpfile, state->filename, strerror(errno));
         }
+#ifdef _WIN32
     }
+#endif
 
     free(tmpfile);
 

--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the commits mailing list