mirror of
https://github.com/ostreedev/ostree.git
synced 2025-03-19 22:50:35 +03:00
checkout: Save errno when re-throwing
I was seeing an `EPERM` here which was confusing. It turned out the real error was `EEXIST`. Since we're referring to the original error, but we do a lot of computation in the middle, we need to save errno.
This commit is contained in:
parent
28a0792919
commit
87d115706e
@ -481,6 +481,7 @@ checkout_file_hardlink (OstreeRepo *self,
|
||||
}
|
||||
else if (errno == EEXIST)
|
||||
{
|
||||
int saved_errno = errno;
|
||||
/* When we get EEXIST, we need to handle the different overwrite modes. */
|
||||
switch (options->overwrite_mode)
|
||||
{
|
||||
@ -566,6 +567,7 @@ checkout_file_hardlink (OstreeRepo *self,
|
||||
else
|
||||
{
|
||||
g_assert_cmpint (options->overwrite_mode, ==, OSTREE_REPO_CHECKOUT_OVERWRITE_UNION_IDENTICAL);
|
||||
errno = saved_errno;
|
||||
return glnx_throw_errno_prefix (error, "Hardlinking %s to %s", loose_path, destination_name);
|
||||
}
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user