summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSaurabh Shah2017-08-01 15:54:21 -0500
committerMarissa Wall2017-09-25 17:51:46 -0500
commit90a74600d772ee578aaf5c63005e2d80b0d223c9 (patch)
treef8ac4b2019959b65429abfdc2ad3c52b3574d5c7 /libsync
parent22a10f6766cd3ae07217b9a93c44381f52aa7018 (diff)
downloadplatform-system-core-90a74600d772ee578aaf5c63005e2d80b0d223c9.tar.gz
platform-system-core-90a74600d772ee578aaf5c63005e2d80b0d223c9.tar.xz
platform-system-core-90a74600d772ee578aaf5c63005e2d80b0d223c9.zip
sync: store the num_fences from first SYNC_IOC_FILE_INFO
Fixes a bug with the signal time of devices using the modern sync file interface. The bug only affects kernels running an Android kernel 4.9 and later. b/63395253 Test: tests/sync_test.cpp Change-Id: I6fb00bcb8e16a3268c357153edd8e35a44546caa
Diffstat (limited to 'libsync')
-rw-r--r--libsync/sync.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libsync/sync.c b/libsync/sync.c
index e65765894..6b187faed 100644
--- a/libsync/sync.c
+++ b/libsync/sync.c
@@ -217,6 +217,8 @@ static struct sync_file_info *modern_sync_file_info(int fd)
217 local_info.num_fences * sizeof(struct sync_fence_info)); 217 local_info.num_fences * sizeof(struct sync_fence_info));
218 if (!info) 218 if (!info)
219 return NULL; 219 return NULL;
220
221 info->num_fences = local_info.num_fences;
220 info->sync_fence_info = (__u64)(uintptr_t)(info + 1); 222 info->sync_fence_info = (__u64)(uintptr_t)(info + 1);
221 223
222 err = ioctl(fd, SYNC_IOC_FILE_INFO, info); 224 err = ioctl(fd, SYNC_IOC_FILE_INFO, info);