lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160426134907.GC20998@kernel.org>
Date:	Tue, 26 Apr 2016 10:49:07 -0300
From:	Arnaldo Carvalho de Melo <acme@...nel.org>
To:	Masami Hiramatsu <mhiramat@...nel.org>
Cc:	linux-kernel@...r.kernel.org, Namhyung Kim <namhyung@...nel.org>,
	Peter Zijlstra <peterz@...radead.org>,
	Ingo Molnar <mingo@...hat.com>,
	Hemant Kumar <hemant@...ux.vnet.ibm.com>,
	Ananth N Mavinakayanahalli <ananth@...ux.vnet.ibm.com>
Subject: Re: [PATCH perf/core v4 06/19] perf-probe: Let probe_file__add_event
 return 0 if succeeded

Em Tue, Apr 26, 2016 at 06:03:04PM +0900, Masami Hiramatsu escreveu:
> Since other methods return 0 if succeeded (or filedesc),
> let probe_file__add_event() return 0 instead of the length
> of written bytes.

Thanks, applied.

- Arnaldo
 
> Signed-off-by: Masami Hiramatsu <mhiramat@...nel.org>
> ---
>  tools/perf/util/probe-file.c |    3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/tools/perf/util/probe-file.c b/tools/perf/util/probe-file.c
> index e3b3b92..3fe6214 100644
> --- a/tools/perf/util/probe-file.c
> +++ b/tools/perf/util/probe-file.c
> @@ -220,8 +220,7 @@ int probe_file__add_event(int fd, struct probe_trace_event *tev)
>  
>  	pr_debug("Writing event: %s\n", buf);
>  	if (!probe_event_dry_run) {
> -		ret = write(fd, buf, strlen(buf));
> -		if (ret <= 0) {
> +		if (write(fd, buf, strlen(buf)) < (int)strlen(buf)) {
>  			ret = -errno;
>  			pr_warning("Failed to write event: %s\n",
>  				   strerror_r(errno, sbuf, sizeof(sbuf)));

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ