From: Namhyung Kim <namhyung@kernel.org>
To: Arnaldo Carvalho de Melo <acme@kernel.org>, Jiri Olsa <jolsa@redhat.com>
Cc: Ingo Molnar <mingo@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Stephane Eranian <eranian@google.com>,
LKML <linux-kernel@vger.kernel.org>,
Namhyung Kim <namhyung.kim@lge.com>
Subject: [PATCH v3 1/3] perf tools: Handle EINTR error for readn/writen
Date: Thu, 24 Apr 2014 22:27:32 +0900 [thread overview]
Message-ID: <1398346054-3322-1-git-send-email-namhyung@kernel.org> (raw)
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
next reply other threads:[~2014-04-24 13:27 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-24 13:27 Namhyung Kim [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1398346054-3322-1-git-send-email-namhyung@kernel.org \
--to=namhyung@kernel.org \
--cc=acme@kernel.org \
--cc=eranian@google.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung.kim@lge.com \
--cc=peterz@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®