Repository navigation
fix(executor,builtins): #872 fd-table nits — move_to_high_fd comment + single-source fd defaults + drop dead field - #885
Conversation
…correction, single-source fd default pair, drop write-only next_dynamic_fd
- compound_exec.rs / external_setup.rs: move_to_high_fd (general.c:681) is
dup2-backed (F_GETFD scan + dup2), not fcntl F_DUPFD; F_DUPFD is the
redir.c:942 mechanism for {var} allocation. Rewrite the comments to
describe the real GNU mechanism and note that the low-first fallback is
a pre-existing simplification of GNU's high-side scan.
- fd_table.rs / ulimit.rs: the default RLIMIT_NOFILE pair (soft 10240 /
hard 1048576) was hardcoded in two places; ulimit::default_for now reads
FdTable::DEFAULT_OPEN_FILES_SOFT_LIMIT / UNLIMITED_OPEN_FILES_CEILING so
the reporting side and allocator ceiling share one source (rubash#872).
- fd_table.rs: next_dynamic_fd was write-only (assigned, never read);
drop the field and its updates.
Zero behavior change; fd + ulimit family regressions green.
|
欢迎!这是你的第一个 PR 🎉 请确认已跑过本地测试套件;CI 通过后维护者会 review。 |
评审结论:APPROVE ✅(#872 fd-table nits 清包 — 独立评审,基于自建 worktree @ a1d4655,逐项实测)1. 三项 nit 逐项核对 — 全部落实① move_to_high_fd 坐标/机制注释(compound_exec.rs / external_setup.rs)— 准确。
② fd 默认对双点钉死收敛 — 落实。 ③ next_dynamic_fd 死字段 — 删除正确。 2. 行为零变更 — 证实5 文件 diff 逐一归类:compound_exec.rs / external_setup.rs 纯注释改写(代码行未动);ulimit.rs 同值常量替换;fd_table.rs 死字段删除;mod.rs 可见性。无任何逻辑变更。 3. 越界审计与已合并内容冲突面 — 干净
4. GPL / fmt / warnings / 进程卫生 — 通过
结论APPROVE — 三项 nit 全部按 #872 意图落实且注释与 bash-5.3 源码逐行吻合,行为零变更获 20 例 fd 回归实证,越界/冲突面/GPL/进程卫生全部干净。无阻塞项,无新增 nit。不代合并,合并交由维护者。 |
What
Closes #872. Three zero-behavior cleanups from PR #870's CR round:
compound_exec.rs/external_setup.rsdescribedmove_to_high_fd(general.c:681) as fcntlF_DUPFD-backed. It is actuallydup2-backed: GNU scans downward frommaxfd-1withfcntl(F_GETFD)anddup2()s into the first free slot.F_DUPFDis the other mechanism (redir.c:942) backing{var}allocation. Comments now describe the real mechanism and note the low-first fallback is a pre-existing simplification of GNU's high-side scan.fd_table.rsandulimit.rs.ulimit::default_fornow readsFdTable::DEFAULT_OPEN_FILES_SOFT_LIMIT/UNLIMITED_OPEN_FILES_CEILINGso the reporting side and allocator ceiling share one declaration point.FdTable::next_dynamic_fdwas write-only (assigned at init and after each allocation, never read). Field and writes removed.Verification
cargo buildclean;cargo fmt --checkclean.cargo test --test issue773_fd_table_capacity_regressions --test issue844_848_popd_pushd_readonly_range_regressions: 19/19 green.cargo clippy --lib: same 5 pre-existing deny-lints as master (uname.rs never-loops, trap_exec.rs almost-swap, conditional.rs eq_op + invalid_regex, process_substitution.rs almost-swap) — unchanged by this PR.Zero behavior change.