提交 d20daf0a 编写于 作者: B Brenda Streiff 提交者: Zheng Zengkai

kconfig: let 'shell' return enough output for deep path names

stable inclusion
from stable-v5.10.102
commit 30455322787aee4bb95dcaabdcfcfaab69a1a8f0
bugzilla: https://gitee.com/openeuler/kernel/issues/I567K6

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=30455322787aee4bb95dcaabdcfcfaab69a1a8f0

--------------------------------

[ Upstream commit 8a4c5b2a ]

The 'shell' built-in only returns the first 256 bytes of the command's
output. In some cases, 'shell' is used to return a path; by bumping up
the buffer size to 4096 this lets us capture up to PATH_MAX.

The specific case where I ran into this was due to commit 1e860048
("gcc-plugins: simplify GCC plugin-dev capability test"). After this
change, we now use `$(shell,$(CC) -print-file-name=plugin)` to return
a path; if the gcc path is particularly long, then the path ends up
truncated at the 256 byte mark, which makes the HAVE_GCC_PLUGINS
depends test always fail.
Signed-off-by: NBrenda Streiff <brenda.streiff@ni.com>
Signed-off-by: NMasahiro Yamada <masahiroy@kernel.org>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NYu Liao <liaoyu15@huawei.com>
Reviewed-by: NWei Li <liwei391@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 601b9fed
...@@ -141,7 +141,7 @@ static char *do_lineno(int argc, char *argv[]) ...@@ -141,7 +141,7 @@ static char *do_lineno(int argc, char *argv[])
static char *do_shell(int argc, char *argv[]) static char *do_shell(int argc, char *argv[])
{ {
FILE *p; FILE *p;
char buf[256]; char buf[4096];
char *cmd; char *cmd;
size_t nread; size_t nread;
int i; int i;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册