diff options
author | Luca Bruno <luca.bruno@coreos.com> | 2021-08-27 07:33:27 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-27 07:33:27 +0000 |
commit | 7fb0266df6f08d605c9a07315f4e0fcb77e57b25 (patch) | |
tree | a441a5b149c57378ca129834e6d6da7e703455da | |
parent | 77a86ccba31d742654fb167d1c6af23933215e28 (diff) | |
parent | 87d115706eed52069e54785b87108c97a44a0343 (diff) | |
download | ostree-7fb0266df6f08d605c9a07315f4e0fcb77e57b25.tar.gz |
Merge pull request #2425 from cgwalters/hardlink-correct-errno
checkout: Save errno when re-throwing
-rw-r--r-- | src/libostree/ostree-repo-checkout.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libostree/ostree-repo-checkout.c b/src/libostree/ostree-repo-checkout.c index eaa33a28..bdd93e7c 100644 --- a/src/libostree/ostree-repo-checkout.c +++ b/src/libostree/ostree-repo-checkout.c @@ -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; |