mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2025-02-16 23:27:17 +02:00
unshareFilesystem
: Do not assume caller
This commit is contained in:
parent
bd7a074636
commit
d5fdfdc592
2 changed files with 7 additions and 2 deletions
|
@ -580,7 +580,12 @@ struct curlFileTransfer : public FileTransfer
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if __linux__
|
#if __linux__
|
||||||
unshareFilesystem();
|
try {
|
||||||
|
unshareFilesystem();
|
||||||
|
} catch (nix::Error & e) {
|
||||||
|
e.addTrace({}, "in download thread");
|
||||||
|
throw;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
std::map<CURL *, std::shared_ptr<TransferItem>> items;
|
std::map<CURL *, std::shared_ptr<TransferItem>> items;
|
||||||
|
|
|
@ -140,7 +140,7 @@ void restoreMountNamespace()
|
||||||
void unshareFilesystem()
|
void unshareFilesystem()
|
||||||
{
|
{
|
||||||
if (unshare(CLONE_FS) != 0 && errno != EPERM)
|
if (unshare(CLONE_FS) != 0 && errno != EPERM)
|
||||||
throw SysError("unsharing filesystem state in download thread");
|
throw SysError("unsharing filesystem state");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue