Skip to contentSkip to conversation

perf record: Use correct return type for write()

PATCH New Adrian Hunter 2 participants 2 messages Nov 8, 2013 – Nov 12, 2013 perf events

lore
Share & tools
lore

Adrian Hunter

author reviewer
#0 lore raw

PATCH 1/1 perf record: Use correct return type for write()

write() returns a 'ssize_t' not an 'int'.

---
 tools/perf/builtin-record.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/builtin-record.c +1 -1
index 15280b5..20df1f3 100644
@@ -81,7 +81,7 @@ static int write_output(struct perf_record *rec, void *buf, size_t size)
 	struct perf_data_file *file = &rec->file;
 
 	while (size) {
-		int ret = write(file->fd, buf, size);
+		ssize_t ret = write(file->fd, buf, size);
 
 		if (ret < 0) {
 			pr_err("failed to write perf data, error: %m\n");
Signature · 1 line
1.7.11.7
#1 lore raw

[tip:perf/urgent] perf record: Use correct return type for write( )

perf record: Use correct return type for write()
Commit-ID:  410f17860318f36b999a90138f50350e3dc49933
Gitweb:     http://git.kernel.org/tip/410f17860318f36b999a90138f50350e3dc49933
Author:     Adrian Hunter <[email protected]>
AuthorDate: Fri, 8 Nov 2013 12:27:50 +0200
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Mon, 11 Nov 2013 15:56:40 -0300

perf record: Use correct return type for write()

write() returns a 'ssize_t' not an 'int'.

Cc David Ahern <[email protected]>
Cc Frederic Weisbecker <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Jiri Olsa <[email protected]>
Cc Mike Galbraith <[email protected]>
Cc Namhyung Kim <[email protected]>
Cc Paul Mackerras <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Stephane Eranian <[email protected]>
---
 tools/perf/builtin-record.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/builtin-record.c +1 -1
index fc68b26..8f5af32 100644
@@ -81,7 +81,7 @@ static int write_output(struct perf_record *rec, void *buf, size_t size)
 	struct perf_data_file *file = &rec->file;
 
 	while (size) {
-		int ret = write(file->fd, buf, size);
+		ssize_t ret = write(file->fd, buf, size);
 
 		if (ret < 0) {
 			pr_err("failed to write perf data, error: %m\n");