diff --git a/gio/gfile.c b/gio/gfile.c index 4e25d38ca..65083efb7 100644 --- a/gio/gfile.c +++ b/gio/gfile.c @@ -3758,7 +3758,7 @@ g_file_make_directory_with_parents (GFile *file, return FALSE; g_file_make_directory (file, cancellable, &my_error); - if (my_error == NULL || my_error->code != G_IO_ERROR_NOT_FOUND) + if (!g_error_matches (my_error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND)) { if (my_error) g_propagate_error (error, my_error); @@ -3767,7 +3767,7 @@ g_file_make_directory_with_parents (GFile *file, work_file = g_object_ref (file); - while (my_error != NULL && my_error->code == G_IO_ERROR_NOT_FOUND) + while (g_error_matches (my_error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND)) { GFile *parent_file; @@ -3786,7 +3786,7 @@ g_file_make_directory_with_parents (GFile *file, g_object_unref (work_file); work_file = g_object_ref (parent_file); - if (my_error != NULL && my_error->code == G_IO_ERROR_NOT_FOUND) + if (g_error_matches (my_error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND)) list = g_list_prepend (list, parent_file); /* Transfer ownership of ref */ else g_object_unref (parent_file);