mirror of
https://github.com/NixOS/nix
synced 2025-06-25 19:01:16 +02:00
Merge pull request #13069 from DeterminateSystems/fix-freebsd
Fix signedness error on FreeBSD
This commit is contained in:
commit
36fa9b90d8
1 changed files with 1 additions and 1 deletions
|
@ -57,7 +57,7 @@ size_t savedStackSize = 0;
|
||||||
void setStackSize(size_t stackSize)
|
void setStackSize(size_t stackSize)
|
||||||
{
|
{
|
||||||
struct rlimit limit;
|
struct rlimit limit;
|
||||||
if (getrlimit(RLIMIT_STACK, &limit) == 0 && limit.rlim_cur < stackSize) {
|
if (getrlimit(RLIMIT_STACK, &limit) == 0 && static_cast<size_t>(limit.rlim_cur) < stackSize) {
|
||||||
savedStackSize = limit.rlim_cur;
|
savedStackSize = limit.rlim_cur;
|
||||||
limit.rlim_cur = std::min(static_cast<rlim_t>(stackSize), limit.rlim_max);
|
limit.rlim_cur = std::min(static_cast<rlim_t>(stackSize), limit.rlim_max);
|
||||||
if (setrlimit(RLIMIT_STACK, &limit) != 0) {
|
if (setrlimit(RLIMIT_STACK, &limit) != 0) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue