Skip to content
Snippets Groups Projects
Commit 2eb4bcc2 authored by Simon McVittie's avatar Simon McVittie
Browse files

glnx-shutil: Cope with ENOENT even after recursing to create parents


If we try to create `link/content` where `link` is a dangling symlink,
recursing to create `link` will succeed (mkdirat fails with EEXIST,
which is explicitly ignored), but then mkdirat for `link/content` will
still fail. Fail gracefully instead of crashing out with an assertion
failure.

Resolves: GNOME/libglnx#1
Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
parent f44d9442
No related branches found
No related tags found
1 merge request!777Update libglnx to 2025-01-06
......@@ -149,12 +149,10 @@ mkdir_p_at_internal (int dfd,
again:
if (mkdirat (dfd, path, mode) == -1)
{
if (errno == ENOENT)
if (errno == ENOENT && !did_recurse)
{
char *lastslash;
g_assert (!did_recurse);
lastslash = strrchr (path, '/');
if (lastslash == NULL)
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment