Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf ui scripts: Switch FILENAME_MAX to NAME_MAX

FILENAME_MAX is the same as PATH_MAX (4kb) in glibc rather than
NAME_MAX's 255. Switch to using NAME_MAX and ensure the '\0' is
accounted for in the path's buffer size.

Signed-off-by: Ian Rogers <irogers@google.com>
Link: https://lore.kernel.org/r/20250717150855.1032526-3-irogers@google.com
Signed-off-by: Namhyung Kim <namhyung@kernel.org>

authored by

Ian Rogers and committed by
Namhyung Kim
008b7575 82aac553

+1 -1
+1 -1
tools/perf/ui/browsers/scripts.c
··· 94 94 FILE *fp; 95 95 96 96 { 97 - char filename[FILENAME_MAX + 5]; 97 + char filename[NAME_MAX + 5]; 98 98 int fd; 99 99 100 100 scnprintf(filename, sizeof(filename), "bin/%s-record", scriptname);