[PATCH] tools: hv: handle EINTR in hv_fcopy_daemon

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---
 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);
 		}
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux