mirror-linux/tools/lib/subcmd
Ian Rogers 5ce42b5de4 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>
2024-10-28 09:32:57 -07:00
..
Build
Makefile tools: Drop nonsensical -O6 2024-09-11 13:08:36 -03:00
exec-cmd.c libsubcmd: Avoid two path statics, removing 8192 bytes from .bss 2023-05-28 10:25:55 -03:00
exec-cmd.h
help.c libsubcmd: Fix memory leak in uniq() 2024-01-04 18:29:17 -03:00
help.h
pager.c
pager.h
parse-options.c libsubcmd: Don't free the usage string 2024-09-04 09:54:24 -03:00
parse-options.h tools/lib/subcmd: Replace NORETURN usage with __noreturn 2023-05-16 06:31:54 -07:00
run-command.c tools subcmd: Add non-waitpid check_if_command_finished() 2024-10-28 09:32:57 -07:00
run-command.h tools subcmd: Add check_if_command_finished() 2024-04-08 17:43:20 -03:00
sigchain.c
sigchain.h
subcmd-config.c
subcmd-config.h
subcmd-util.h tools/lib/subcmd: Replace NORETURN usage with __noreturn 2023-05-16 06:31:54 -07:00