Commit Graph
7 Commits
Author SHA1 Message Date
Lars Wirzenius 582bd54b73 refactor: drop commented-out constants
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-05-14 08:20:05 +03:00
Lars Wirzenius e494961227 refactor: drop unnecessary pragma for allowing dead code
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-05-14 08:06:48 +03:00
Lars Wirzenius 55023f2e4f refactor: rewrite the timeoutcmd module for simplicity
Feed child process stdin via a temporary file. This is simpler than
opening a pipe and spawning a thread that feeds the pipe, when it's
not full.

Capture child stderr into a buffer without trying to let the
caller (another thread) process it line by line. We don't seem to have
use for that, and this simplifies things a fair bit.

Simplify the capture of child stdout to use a simpler thread and data
structure, compared to the previous multi-thread setup. Splitting
stdout into lines is now done by the thread that consumes the lines,
making the code that captures it simpler.

Also update the timeout subcommand to work with the changes. Other
callers of this code aren't yet updated.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-05-13 09:02:12 +03:00
Fintan Halpenny 8cbc1fe313 refactor: change test shell commands
While setting up a Nix flake, a series of tests were failing due to shell
invocations. The falling were the changes required:

- Use `!#/bin/sh` instead of `!#/bin/bash`
- Use `$$` instead of `$BASHPID`
- Use `true` and `false` instead of `/bin/true` and `/bin/false`

It was also noted that the `git-remote-helper` is needed alongside the `rad`
binary for some of the acceptance tests to work.
2025-01-24 10:23:49 +00:00
Lars Wirzenius fda28dbaae fix(src/timeoutcmd.rs): say stderr, instead of stdout
Signed-off-by: Lars Wirzenius <liw@liw.fi>
2025-01-08 13:47:56 +02:00
Lars Wirzenius f3b83c30d8 feat: drop timeoutcmd.rs log messages to trace level
Also move them to logger.rs.

Signed-off-by: Lars Wirzenius <liw@liw.fi>
2024-11-12 09:19:45 +02:00
Lars Wirzenius 68f392dd78 feat: add a module to run a sub-process with a time limit
Also, capture its stdout and stderr.
2024-11-06 16:23:51 +02:00