1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-20 09:19:36 +01:00

Split ignoreException for destructors or interrupt-safe

This commit is contained in:
Robert Hensing 2024-09-30 11:49:53 +02:00
parent a1415471b8
commit 3df619339c
27 changed files with 164 additions and 125 deletions

View file

@ -91,7 +91,7 @@ HookInstance::~HookInstance()
toHook.writeSide = -1;
if (pid != -1) pid.kill();
} catch (...) {
ignoreException();
ignoreExceptionInDestructor();
}
}

View file

@ -109,9 +109,9 @@ LocalDerivationGoal::~LocalDerivationGoal()
{
/* Careful: we should never ever throw an exception from a
destructor. */
try { deleteTmpDir(false); } catch (...) { ignoreException(); }
try { killChild(); } catch (...) { ignoreException(); }
try { stopDaemon(); } catch (...) { ignoreException(); }
try { deleteTmpDir(false); } catch (...) { ignoreExceptionInDestructor(); }
try { killChild(); } catch (...) { ignoreExceptionInDestructor(); }
try { stopDaemon(); } catch (...) { ignoreExceptionInDestructor(); }
}
@ -1531,7 +1531,7 @@ void LocalDerivationGoal::startDaemon()
NotTrusted, daemon::Recursive);
debug("terminated daemon connection");
} catch (SystemError &) {
ignoreException();
ignoreExceptionExceptInterrupt();
}
});