Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1399108
| From | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH perf/core v7 01/21] tools/perf: Fix lsdir to set errno correctly |
| Date | 2016-05-11 16:00 +0200 |
| Message-ID | <rxCQa-UH-25@gated-at.bofh.it> (permalink) |
| References | <rxCQa-UH-17@gated-at.bofh.it> <rxCQa-UH-27@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Em Wed, May 11, 2016 at 10:51:27PM +0900, Masami Hiramatsu escreveu:
> Fix lsdir() to set correct positive error number (ENOMEM).
> Since "errno" must have a positive error number instead of
> negative number, fix lsdir to set it correctly.
Masami, please try to:
1) Follow existing convention when writing the patch Subject line, when
in doubt: git log tools/perf/util/util.c and check, in this case I
changed it to "perf tools: Fix lsdir to set errno correctly"
2) Add a Fixed line, for this case I used 'git blame' and added:
Fixes: e1ce726e1db2 ("perf tools: Add lsdir() helper to read a directory")
This helps reviewing (now and down the line), because one can go more
quickly check what was the intention in the original patch, to see if it
is really a fix.
In some cases this looks trivial, like in this patch, sometimes its
not...
Thanks,
- Arnaldo
> Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
> ---
> tools/perf/util/util.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/perf/util/util.c b/tools/perf/util/util.c
> index 01c9433..eab077a 100644
> --- a/tools/perf/util/util.c
> +++ b/tools/perf/util/util.c
> @@ -139,7 +139,7 @@ struct strlist *lsdir(const char *name,
>
> list = strlist__new(NULL, NULL);
> if (!list) {
> - errno = -ENOMEM;
> + errno = ENOMEM;
> goto out;
> }
>
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
Re: [PATCH perf/core v7 01/21] tools/perf: Fix lsdir to set errno correctly Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-05-11 16:00 +0200 Re: [PATCH perf/core v7 01/21] tools/perf: Fix lsdir to set errno correctly Masami Hiramatsu <mhiramat@kernel.org> - 2016-05-12 03:50 +0200
csiph-web