[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-e148c76083dc06ce618d768c0bee0a0edda96a54@git.kernel.org>
Date: Wed, 30 Apr 2014 23:30:38 -0700
From: tip-bot for Namhyung Kim <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, hpa@...or.com, mingo@...nel.org,
jolsa@...nel.org, tglx@...utronix.de, namhyung@...nel.org
Subject: [tip:perf/core] perf tools: Handle EINTR error for readn/writen
Commit-ID: e148c76083dc06ce618d768c0bee0a0edda96a54
Gitweb: http://git.kernel.org/tip/e148c76083dc06ce618d768c0bee0a0edda96a54
Author: Namhyung Kim <namhyung@...nel.org>
AuthorDate: Thu, 24 Apr 2014 22:27:32 +0900
Committer: Jiri Olsa <jolsa@...nel.org>
CommitDate: Tue, 29 Apr 2014 14:26:30 +0200
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@...nel.org>
Link: http://lkml.kernel.org/r/1398346054-3322-1-git-send-email-namhyung@kernel.org
Signed-off-by: Jiri Olsa <jolsa@...nel.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 9f66549..7fff6be 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;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists