unshareFilesystem: Do not assume caller

This commit is contained in:
John Ericson committed 2024-05-22 16:07:34 -04:00
1 parent bd7a074636
commit d5fdfdc592
2 files changed
+7 -2

No files matched your search

+6 -1
View File
@@ -580,7 +580,12 @@ struct curlFileTransfer : public FileTransfer
#endif
#if __linux__
unshareFilesystem();
try {
unshareFilesystem();
} catch (nix::Error & e) {
e.addTrace({}, "in download thread");
throw;
}
#endif
std::map<CURL *, std::shared_ptr<TransferItem>> items;
+1 -1
View File
@@ -140,7 +140,7 @@ void restoreMountNamespace()
void unshareFilesystem()
{
if (unshare(CLONE_FS) != 0 && errno != EPERM)
throw SysError("unsharing filesystem state in download thread");
throw SysError("unsharing filesystem state");
}
}