db845c: qcom: rmtfs: Keep /dev/qcom_rmtfs_memX fd open am: 8bd2e61f62 am: 2cfc1a9998
Change-Id: Ide4a1c2acd29fc6077fc5ff38ac7972d7e6929a5
diff --git a/qcom/rmtfs/sharedmem.c b/qcom/rmtfs/sharedmem.c
index 66bbd5d..fb31720 100644
--- a/qcom/rmtfs/sharedmem.c
+++ b/qcom/rmtfs/sharedmem.c
@@ -211,6 +211,14 @@
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);
fd = open(path, O_RDONLY);
if (fd < 0) {