Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756159AbdHYLJI (ORCPT ); Fri, 25 Aug 2017 07:09:08 -0400 Received: from mo4-p00-ob.smtp.rzone.de ([81.169.146.163]:24982 "EHLO mo4-p00-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756031AbdHYLJG (ORCPT ); Fri, 25 Aug 2017 07:09:06 -0400 X-RZG-AUTH: :P2EQZWCpfu+qG7CngxMFH1J+yackYocTD1iAi8x+OWi/zfN1cLnAYQz4mzReZKAqPT2tb6Nx5EL7HQvAw3tBGHnS2eB9 X-RZG-CLASS-ID: mo00 From: Olaf Hering To: "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , devel@linuxdriverproject.org (open list:Hyper-V CORE AND DRIVERS), linux-kernel@vger.kernel.org (open list) Cc: Olaf Hering Subject: [PATCH] tools: hv: handle EINTR in hv_fcopy_daemon Date: Fri, 25 Aug 2017 13:02:46 +0200 Message-Id: <20170825110246.28397-1-olaf@aepfle.de> X-Mailer: git-send-email 2.14.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 696 Lines: 21 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 --- 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); }