Revert change below. It wasn't a good idea after all, says the original
authorTor Lillqvist <tml@novell.com>
Fri, 31 Mar 2006 19:16:23 +0000 (19:16 +0000)
committerTor Lillqvist <tml@src.gnome.org>
Fri, 31 Mar 2006 19:16:23 +0000 (19:16 +0000)
2006-03-31  Tor Lillqvist  <tml@novell.com>

* glib/gstdio.c (g_remove): Revert change below. It wasn't a good
idea after all, says the original bug reporter. See bug for
discussion.

ChangeLog
ChangeLog.pre-2-12
glib/gstdio.c

index a537837..95f90c8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-03-31  Tor Lillqvist  <tml@novell.com>
+
+       * glib/gstdio.c (g_remove): Revert change below. It wasn't a good
+       idea after all, says the original bug reporter. See bug for
+       discussion.
+
 2006-03-30  Tor Lillqvist  <tml@novell.com>
 
        * glib/gstdio.c (g_remove): [Win32] call rmdir() only if remove()
index a537837..95f90c8 100644 (file)
@@ -1,3 +1,9 @@
+2006-03-31  Tor Lillqvist  <tml@novell.com>
+
+       * glib/gstdio.c (g_remove): Revert change below. It wasn't a good
+       idea after all, says the original bug reporter. See bug for
+       discussion.
+
 2006-03-30  Tor Lillqvist  <tml@novell.com>
 
        * glib/gstdio.c (g_remove): [Win32] call rmdir() only if remove()
index ac13ef6..b772591 100644 (file)
@@ -758,6 +758,11 @@ g_unlink (const gchar *filename)
  * Windows, it is in general not possible to remove a file that is
  * open to some process, or mapped into memory.
  *
+ * If this function fails on Windows you can't infer too much from the
+ * errno value. rmdir() is tried regardless of what caused remove() to
+ * fail. Any errno value set by remove() will be overwritten by that
+ * set by rmdir().
+ *
  * Returns: 0 if the file was successfully removed, -1 if an error 
  *    occurred
  * 
@@ -780,7 +785,7 @@ g_remove (const gchar *filename)
        }
 
       retval = _wremove (wfilename);
-      if (retval == -1 && errno == ENOENT)
+      if (retval == -1)
        retval = _wrmdir (wfilename);
       save_errno = errno;
 
@@ -802,7 +807,7 @@ g_remove (const gchar *filename)
        }
 
       retval = remove (cp_filename);
-      if (retval == -1 && errno == ENOENT)
+      if (retval == -1)
        retval = rmdir (cp_filename);
       save_errno = errno;