tools subcmd: Tighten the filename size in check_if_command_finished
authorIan Rogers <irogers@google.com>
Thu, 17 Jul 2025 15:08:53 +0000 (08:08 -0700)
committerNamhyung Kim <namhyung@kernel.org>
Wed, 23 Jul 2025 01:17:53 +0000 (18:17 -0700)
commit478272d1cdd9959a6d638e9d81f70642f04290c9
tree5606018b060cfad92b7adf53618c40286a34316f
parent129f70bd6063d701c3ecb63ecdd4b5ee520cfd45
tools subcmd: Tighten the filename size in check_if_command_finished

FILENAME_MAX is often PATH_MAX (4kb), far more than needed for the
/proc path. Make the buffer size sufficient for the maximum integer
plus "/proc/" and "/status" with a '\0' terminator.

Fixes: 5ce42b5de461 ("tools subcmd: Add non-waitpid check_if_command_finished()")
Signed-off-by: Ian Rogers <irogers@google.com>
Link: https://lore.kernel.org/r/20250717150855.1032526-1-irogers@google.com
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
tools/lib/subcmd/run-command.c