Commit 008b7575 authored by Ian Rogers's avatar Ian Rogers Committed by Namhyung Kim
Browse files

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: default avatarIan Rogers <irogers@google.com>
Link: https://lore.kernel.org/r/20250717150855.1032526-3-irogers@google.com


Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
parent 82aac553
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -94,7 +94,7 @@ static int check_ev_match(int dir_fd, const char *scriptname, struct perf_sessio
	FILE *fp;

	{
		char filename[FILENAME_MAX + 5];
		char filename[NAME_MAX + 5];
		int fd;

		scnprintf(filename, sizeof(filename), "bin/%s-record", scriptname);