mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-10-01 15:38:35 +00:00
Move resource limits to a dedicated struct, restore before preexec
This commit is contained in:
@@ -176,13 +176,13 @@ fn startPosix(self: *Command, arena: Allocator) !void {
|
||||
// We don't log because that'll show up in the output.
|
||||
};
|
||||
|
||||
// Restore any rlimits that were set by Ghostty. This might fail but
|
||||
// any failures are ignored (its best effort).
|
||||
global_state.rlimits.restore();
|
||||
|
||||
// If the user requested a pre exec callback, call it now.
|
||||
if (self.pre_exec) |f| f(self);
|
||||
|
||||
if (global_state.rlimits.nofile) |lim| {
|
||||
internal_os.restoreMaxFiles(lim);
|
||||
}
|
||||
|
||||
// Finally, replace our process.
|
||||
_ = posix.execveZ(pathZ, argsZ, envp) catch null;
|
||||
|
||||
|
Reference in New Issue
Block a user