sharedmem: Keep /dev/qcom_rmtfs_memX fd open

/dev/qcom_rmtfs_mem0 fd is required to share the data.

Fixes: 9ef260ba6f ("ANDROID: Add Android support")
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
This commit is contained in:
Amit Pundir 2020-02-13 19:42:46 +05:30 committed by Bjorn Andersson
parent 9ef260ba6f
commit ad5f456c18

View File

@ -211,6 +211,14 @@ static int rmtfs_mem_open_rfsa(struct rmtfs_mem *rmem, int client_id)
errno = 0; errno = 0;
snprintf(path, sizeof(path), "/dev/qcom_rmtfs_mem%d", client_id);
rmem->fd = open(path, O_RDWR);
if (rmem->fd < 0) {
saved_errno = errno;
fprintf(stderr, "failed to open %s: %s\n", path, strerror(errno));
return -saved_errno;
}
snprintf(path, sizeof(path), "/sys/class/rmtfs/qcom_rmtfs_mem%d/phys_addr", client_id); snprintf(path, sizeof(path), "/sys/class/rmtfs/qcom_rmtfs_mem%d/phys_addr", client_id);
fd = open(path, O_RDONLY); fd = open(path, O_RDONLY);
if (fd < 0) { if (fd < 0) {