From 2df600a633904eab85fc35315b2099466285f4f7 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Fri, 31 Mar 2006 00:26:44 +0000 Subject: [PATCH] [Win32] call rmdir() only if remove() fails with errno set to ENOENT, to 2006-03-30 Tor Lillqvist * glib/gstdio.c (g_remove): [Win32] call rmdir() only if remove() fails with errno set to ENOENT, to leave errno set to EACCESS if that is the problem. (#334799, Yevgen Muntyan) --- ChangeLog | 6 ++++++ ChangeLog.pre-2-12 | 6 ++++++ glib/gstdio.c | 4 ++-- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index c65c39f..a537837 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2006-03-30 Tor Lillqvist + + * glib/gstdio.c (g_remove): [Win32] call rmdir() only if remove() + fails with errno set to ENOENT, to leave errno set to EACCESS if + that is the problem. (#334799, Yevgen Muntyan) + 2006-03-30 Matthias Clasen * glib/gbookmarkfile.c (g_bookmark_file_get_app_info): Sync diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index c65c39f..a537837 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,9 @@ +2006-03-30 Tor Lillqvist + + * glib/gstdio.c (g_remove): [Win32] call rmdir() only if remove() + fails with errno set to ENOENT, to leave errno set to EACCESS if + that is the problem. (#334799, Yevgen Muntyan) + 2006-03-30 Matthias Clasen * glib/gbookmarkfile.c (g_bookmark_file_get_app_info): Sync diff --git a/glib/gstdio.c b/glib/gstdio.c index fe75643..ac13ef6 100644 --- a/glib/gstdio.c +++ b/glib/gstdio.c @@ -780,7 +780,7 @@ g_remove (const gchar *filename) } retval = _wremove (wfilename); - if (retval == -1) + if (retval == -1 && errno == ENOENT) retval = _wrmdir (wfilename); save_errno = errno; @@ -802,7 +802,7 @@ g_remove (const gchar *filename) } retval = remove (cp_filename); - if (retval == -1) + if (retval == -1 && errno == ENOENT) retval = rmdir (cp_filename); save_errno = errno; -- 2.7.4