diff options
| author | Stefan Boberg <[email protected]> | 2026-04-20 10:59:41 +0200 |
|---|---|---|
| committer | GitHub Enterprise <[email protected]> | 2026-04-20 10:59:41 +0200 |
| commit | 38abebcb6ff417faf431dcaa103bb7f173c4b3f7 (patch) | |
| tree | e03a6f63dafc3e75361f6312621c2699aebbc439 /src/zencore/filesystem.cpp | |
| parent | zenhttp: add FollowRedirects option to HttpClient (#982) (diff) | |
| download | archived-zen-38abebcb6ff417faf431dcaa103bb7f173c4b3f7.tar.xz archived-zen-38abebcb6ff417faf431dcaa103bb7f173c4b3f7.zip | |
zencore: CreateProc stdin pipes + BuildArgV quote stripping (#983)
Two related improvements to `CreateProc`:
### 1. Stdin pipe support
- Adds `StdinPipeHandles` + `CreateStdinPipe` alongside the existing `StdoutPipeHandles`, letting callers feed data into a child process's stdin.
- Platform-agnostic RAII (Windows `HANDLE` pair / POSIX `pipe()` fd pair) with the same semantics as the stdout pipe: the inherited end goes to the child, the non-inherited end stays with the parent, destructor closes both.
- `CreateProcOptions` gains a `StdinPipe*` field.
- On Windows, `CreateProcNormal` is reworked so stdin/stdout redirection handles all combinations (stdin + stdout, each alone, neither) uniformly. POSIX already supported arbitrary fd redirection and just needed to honor the new option.
- `zentest-appstub` gains a `-stdin_echo` mode that reads stdin to EOF and echoes it back (switching to binary mode on Windows so CRLF translation doesn't mangle bytes).
- `zenserver-test` gets a `server.process` / `stdin_pipe.*` test group that exercises launching a child with a stdin pipe, writing, closing the write end, and reading back the echoed data.
### 2. Shell-style quote stripping in `BuildArgV`
- Callers that build a single command-line string for `CreateProc` commonly wrap spacey paths in double quotes (e.g. `--tracefile="$path"`). The old `BuildArgV` only used quotes to suppress space-splitting and left the characters in the resulting argv element, so the spawned process saw literal `--tracefile="..."` and the value parser failed to open the quoted path.
- `BuildArgV` now compacts in place, dropping quote chars as it goes, matching shell semantics for paired double quotes.
Diffstat (limited to 'src/zencore/filesystem.cpp')
0 files changed, 0 insertions, 0 deletions