summaryrefslogtreecommitdiff
path: root/glib/gfileutils.c
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2019-08-08 02:19:39 +0200
committerCarlos Garnacho <carlosg@gnome.org>2019-08-08 02:32:46 +0200
commit3a4a66508378cfb0c794a3760666f560bbea358b (patch)
treea385d16219e7d27ef9f29b6ccbcd11487693b416 /glib/gfileutils.c
parent179fdc5239d07974cb68a56e110d0ae914b8efac (diff)
downloadglib-3a4a66508378cfb0c794a3760666f560bbea358b.tar.gz
gfileutils: Fix error propagation for other than ENOENT
Commit 6f55306e04e5 unintendedly broke error handling for other error conditions than ENOENT along the path, like EPERM. It wanted to ignore ENOENT on all elements except the last in the path, but in doing that it ignored any other error that might happen on the last element. https://gitlab.gnome.org/GNOME/glib/issues/1852
Diffstat (limited to 'glib/gfileutils.c')
-rw-r--r--glib/gfileutils.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/glib/gfileutils.c b/glib/gfileutils.c
index 275647509..f0799e212 100644
--- a/glib/gfileutils.c
+++ b/glib/gfileutils.c
@@ -262,7 +262,7 @@ g_mkdir_with_parents (const gchar *pathname,
if (g_mkdir (fn, mode) == -1 && errno != EEXIST)
{
int errno_save = errno;
- if (p && errno != ENOENT)
+ if (errno != ENOENT || !p)
{
g_free (fn);
errno = errno_save;