]> www.infradead.org Git - users/jedix/linux-maple.git/commit
tools subcmd: Add non-waitpid check_if_command_finished()
authorIan Rogers <irogers@google.com>
Fri, 25 Oct 2024 19:21:00 +0000 (12:21 -0700)
committerNamhyung Kim <namhyung@kernel.org>
Mon, 28 Oct 2024 16:32:57 +0000 (09:32 -0700)
commit5ce42b5de461c3154f61a023b191dd6b77ee66c0
treea4f49cc3673311c4de2bbb44232f22e02be99021
parent150dab31d5609f896fbfaa06b442ca314da79858
tools subcmd: Add non-waitpid check_if_command_finished()

Using waitpid can cause stdout/stderr of the child process to be
lost. Use Linux's /prod/<pid>/status file to determine if the process
has reached the zombie state. Use the 'status' file rather than 'stat'
to avoid issues around skipping the process name.

Tested-by: James Clark <james.clark@linaro.org>
Signed-off-by: Ian Rogers <irogers@google.com>
Cc: Colin Ian King <colin.i.king@gmail.com>
Cc: Howard Chu <howardchu95@gmail.com>
Cc: Weilin Wang <weilin.wang@intel.com>
Cc: Ilya Leoshkevich <iii@linux.ibm.com>
Cc: Thomas Richter <tmricht@linux.ibm.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Dapeng Mi <dapeng1.mi@linux.intel.com>
Cc: Athira Jajeev <atrajeev@linux.vnet.ibm.com>
Cc: Michael Petlan <mpetlan@redhat.com>
Cc: Veronika Molnarova <vmolnaro@redhat.com>
Link: https://lore.kernel.org/r/20241025192109.132482-2-irogers@google.com
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
tools/lib/subcmd/run-command.c