Diff between 569685b75272b49264cbd2f6a10d1fa512672e06 and 1e8a6d5b4de3f729a935fe049cc9300c28132e5c

Changed Files

File Additions Deletions Status
android/avctp.c +11 -1 modified

Full Patch

diff --git a/android/avctp.c b/android/avctp.c
index 8a0d6a1..bc1bd80 100644
--- a/android/avctp.c
+++ b/android/avctp.c
@@ -273,13 +273,23 @@ static gboolean avctp_passthrough_rsp(struct avctp *session, uint8_t code,
 static int send_event(int fd, uint16_t type, uint16_t code, int32_t value)
 {
 	struct uinput_event event;
+	int err;
 
 	memset(&event, 0, sizeof(event));
 	event.type	= type;
 	event.code	= code;
 	event.value	= value;
 
-	return write(fd, &event, sizeof(event));
+	do {
+		err = write(fd, &event, sizeof(event));
+	} while (err < 0 && errno == EINTR);
+
+	if (err < 0) {
+		err = -errno;
+		error("send_event: %s (%d)", strerror(-err), -err);
+	}
+
+	return err;
 }
 
 static void send_key(int fd, uint16_t key, int pressed)