mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-10-02 16:08:39 +00:00
core: if we change RLIMIT_NOFILE, reset it when executing commands
This commit is contained in:
@@ -18,6 +18,7 @@ const Command = @This();
|
||||
|
||||
const std = @import("std");
|
||||
const builtin = @import("builtin");
|
||||
const global_state = &@import("global.zig").state;
|
||||
const internal_os = @import("os/main.zig");
|
||||
const windows = internal_os.windows;
|
||||
const TempDir = internal_os.TempDir;
|
||||
@@ -178,6 +179,10 @@ fn startPosix(self: *Command, arena: Allocator) !void {
|
||||
// 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