aboutsummaryrefslogtreecommitdiff
path: root/src/libutil/current-process.cc
diff options
context:
space:
mode:
authorRobert Hensing <robert@roberthensing.nl>2024-10-01 15:30:30 -0700
committerRebecca Turner <rbt@sent.as>2024-10-01 15:49:56 -0700
commitee0c195eba7d16b796fd9883e3fe88c0d64ff0bf (patch)
tree1048d5203ed5780274bbbd3992f986a5df6a1981 /src/libutil/current-process.cc
parent775292766025380d04004e42fefbdb8ca40b3fa3 (diff)
Split ignoreException to avoid suppressing CTRL-C
This splits `ignoreException` into `ignoreExceptionExceptInterrupt` (which ignores all exceptions except `Interrupt`, which indicates a SIGINT/CTRL-C) and `ignoreExceptionInDestructor` (which ignores all exceptions, so that destructors do not throw exceptions). This prevents many cases where Nix ignores CTRL-C entirely. See: https://github.com/NixOS/nix/issues/7245 Upstream-PR: https://github.com/NixOS/nix/pull/11618 Change-Id: Ie7d2467eedbe840d1b9fa2e88a4e88e4ab26a87b
Diffstat (limited to 'src/libutil/current-process.cc')
-rw-r--r--src/libutil/current-process.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libutil/current-process.cc b/src/libutil/current-process.cc
index 33cda211b..3b3e46a9a 100644
--- a/src/libutil/current-process.cc
+++ b/src/libutil/current-process.cc
@@ -49,7 +49,7 @@ unsigned int getMaxCPU()
auto period = cpuMaxParts[1];
if (quota != "max")
return std::ceil(std::stoi(quota) / std::stof(period));
- } catch (Error &) { ignoreException(lvlDebug); }
+ } catch (Error &) { ignoreExceptionInDestructor(lvlDebug); }
#endif
return 0;