diff options
author | Namhyung Kim <namhyung@kernel.org> | 2014-04-24 09:27:32 -0400 |
---|---|---|
committer | Jiri Olsa <jolsa@kernel.org> | 2014-04-29 08:26:30 -0400 |
commit | e148c76083dc06ce618d768c0bee0a0edda96a54 (patch) | |
tree | 6c044eb662edb540d246a8417d7c2133cc98233b /tools/perf | |
parent | 201131998fbf074b03679afedcc29948e63331ef (diff) |
perf tools: Handle EINTR error for readn/writen
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>
Link: http://lkml.kernel.org/r/1398346054-3322-1-git-send-email-namhyung@kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Diffstat (limited to 'tools/perf')
-rw-r--r-- | tools/perf/util/util.c | 2 |
1 files changed, 2 insertions, 0 deletions
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) | |||
166 | ssize_t ret = is_read ? read(fd, buf, left) : | 166 | ssize_t ret = is_read ? read(fd, buf, left) : |
167 | write(fd, buf, left); | 167 | write(fd, buf, left); |
168 | 168 | ||
169 | if (ret < 0 && errno == EINTR) | ||
170 | continue; | ||
169 | if (ret <= 0) | 171 | if (ret <= 0) |
170 | return ret; | 172 | return ret; |
171 | 173 | ||