mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Olaf Hering <olaf@aepfle.de>
To: "K. Y. Srinivasan" <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	Stephen Hemminger <sthemmin@microsoft.com>,
	devel@linuxdriverproject.org (open list:Hyper-V CORE AND DRIVERS),
	linux-kernel@vger.kernel.org (open list)
Cc: Olaf Hering <olaf@aepfle.de>
Subject: [PATCH] tools: hv: handle EINTR in hv_fcopy_daemon
Date: Fri, 25 Aug 2017 13:02:46 +0200	[thread overview]
Message-ID: <20170825110246.28397-1-olaf@aepfle.de> (raw)

If strace attaches to the daemon pread returns with EINTR, and the
process exits. Catch this case and continue with the next iteration.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
 tools/hv/hv_fcopy_daemon.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/hv/hv_fcopy_daemon.c b/tools/hv/hv_fcopy_daemon.c
index c273dd34d144..574e6bf5865c 100644
--- a/tools/hv/hv_fcopy_daemon.c
+++ b/tools/hv/hv_fcopy_daemon.c
@@ -201,6 +201,8 @@ int main(int argc, char *argv[])
 		ssize_t len;
 		len = pread(fcopy_fd, &buffer, sizeof(buffer), 0);
 		if (len < 0) {
+			if (errno == EINTR)
+				continue;
 			syslog(LOG_ERR, "pread failed: %s", strerror(errno));
 			exit(EXIT_FAILURE);
 		}

             reply	other threads:[~2017-08-25 11:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-25 11:02 Olaf Hering [this message]
2017-08-25 12:27 ` Vitaly Kuznetsov
2017-08-25 12:31   ` Olaf Hering
2017-09-05 18:16     ` KY Srinivasan
2017-09-05 19:40       ` Olaf Hering

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=20170825110246.28397-1-olaf@aepfle.de \
    --to=olaf@aepfle.de \
    --cc=devel@linuxdriverproject.org \
    --cc=haiyangz@microsoft.com \
    --cc=kys@microsoft.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sthemmin@microsoft.com \
    /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

Powered by JetHome