linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 1/3] perf tools: Handle EINTR error for readn/writen
@ 2014-04-24 13:27 Namhyung Kim
  2014-04-24 13:27 ` [PATCH v3 2/3] perf record: Propagate exit status of a command line workload Namhyung Kim
                   ` (2 more replies)
  0 siblings, 3 replies; 19+ messages in thread
From: Namhyung Kim @ 2014-04-24 13:27 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo, Jiri Olsa
  Cc: Ingo Molnar, Peter Zijlstra, Stephane Eranian, LKML, Namhyung Kim

Those readn/writen functions are to ensure read/write does I/O for
a given size exactly.  But ion() - its implementation - does not
handle in case it returns prematurely due to a signal.  As it's not
an error itself so just retry the operation.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
 tools/perf/util/util.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/perf/util/util.c b/tools/perf/util/util.c
index 9f66549562bd..7fff6be07f07 100644
--- a/tools/perf/util/util.c
+++ b/tools/perf/util/util.c
@@ -166,6 +166,8 @@ static ssize_t ion(bool is_read, int fd, void *buf, size_t n)
 		ssize_t ret = is_read ? read(fd, buf, left) :
 					write(fd, buf, left);
 
+		if (ret < 0 && errno == EINTR)
+			continue;
 		if (ret <= 0)
 			return ret;
 
-- 
1.7.9.2


^ permalink raw reply related	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2014-05-08  7:49 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-24 13:27 [PATCH v3 1/3] perf tools: Handle EINTR error for readn/writen Namhyung Kim
2014-04-24 13:27 ` [PATCH v3 2/3] perf record: Propagate exit status of a command line workload Namhyung Kim
2014-04-25 13:17   ` Stephane Eranian
2014-04-29 10:56   ` Jiri Olsa
2014-04-29 11:19     ` Peter Zijlstra
2014-04-29 11:33       ` Peter Zijlstra
2014-04-29 11:38         ` Jiri Olsa
2014-04-29 11:37       ` Jiri Olsa
2014-04-30  0:24         ` Namhyung Kim
2014-05-07 14:00           ` Jiri Olsa
2014-05-07 15:04           ` Peter Zijlstra
2014-05-07 17:19             ` Stephane Eranian
2014-05-07 17:35               ` Peter Zijlstra
2014-05-08  7:49                 ` Namhyung Kim
2014-04-29 11:15   ` Jiri Olsa
2014-04-29 12:11   ` Peter Zijlstra
2014-04-24 13:27 ` [PATCH v3 3/3] perf tools: Get rid of on_exit() feature test Namhyung Kim
2014-04-25 13:18   ` Stephane Eranian
2014-05-01  6:30 ` [tip:perf/core] perf tools: Handle EINTR error for readn/writen tip-bot for Namhyung Kim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).