From: Arnaldo Carvalho de Melo Date: Fri, 14 Oct 2016 20:57:11 +0000 (-0300) Subject: perf tools: Normalize sq_quote_argv() error reporting X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e7b32d12a287a79f2831c1246baf3de0aed95dcc;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git perf tools: Normalize sq_quote_argv() error reporting It already returns whatever strbuf_(grow|addch)() returns in case of failure, so just return -ENOSPC in the only case where it was die()ing. When it returns, its only caller will call die() anyway, so no need to be so eager, die later. Cc: Adrian Hunter Cc: David Ahern Cc: Jiri Olsa Cc: Namhyung Kim Cc: Wang Nan Link: http://lkml.kernel.org/n/tip-as05b7mbogprlwi8iarwns8e@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/util/quote.c b/tools/perf/util/quote.c index 639d1da2f978..293534c1a474 100644 --- a/tools/perf/util/quote.c +++ b/tools/perf/util/quote.c @@ -54,7 +54,7 @@ int sq_quote_argv(struct strbuf *dst, const char** argv, size_t maxlen) break; ret = sq_quote_buf(dst, argv[i]); if (maxlen && dst->len > maxlen) - die("Too many or long arguments"); + return -ENOSPC; } return ret; }