Skip to content

subprocess: Add a SrtCompletedSubprocess object to represent the result

Simon McVittie requested to merge wip/smcv/subproc-object into main

Following on from !629 (merged); prerequisite for a redo of !626 (merged). Only one new commit here:

  • !629 (merged)

  • subprocess: subprocess: Add a SrtCompletedSubprocess object to represent the result

    This is loosely based on the API of Python's subprocess.CompletedProcess. It intentionally isn't exposed to code outside its translation unit until it has finished running.

    This takes over the functionality of _srt_process_timeout_wait_status(), which is used automatically when needed for timeout(1), and can also be requested explicitly with SRT_HELPER_FLAGS_SHELL_EXIT_STATUS if using a wrapper that encodes exit status in the same way such as sh(1) or env(1).

    No functional change intended. The formatting of debug messages will be a little different, because I've used SRT_SUBPROCESS_OUTPUT_CAPTURE_DEBUG instead of open-coding its equivalent.

Edited by Simon McVittie

Merge request reports