db845c: qcom: tqftpserv: Use /data/vendor for temporary files am: 87447675ae am: 37186c1584
Change-Id: Ie834c8105b2326dd5a26b525f0f021479b0de85a
diff --git a/qcom/tqftpserv/translate.c b/qcom/tqftpserv/translate.c
index e95dee5..15df6d8 100644
--- a/qcom/tqftpserv/translate.c
+++ b/qcom/tqftpserv/translate.c
@@ -45,7 +45,13 @@
#define READONLY_PATH "/readonly/firmware/image/"
#define READWRITE_PATH "/readwrite/"
+#ifndef ANDROID
#define FIRMWARE_BASE "/lib/firmware/"
+#define TQFTPSERV_TMP "/tmp/tqftpserv"
+#else
+#define FIRMWARE_BASE "/vendor/firmware/"
+#define TQFTPSERV_TMP "/data/vendor/tmp/tqftpserv"
+#endif
/**
* translate_readonly() - open "file" residing with remoteproc firmware
@@ -142,15 +148,15 @@
int ret;
int fd;
- ret = mkdir("/tmp/tqftpserv", 0700);
+ ret = mkdir(TQFTPSERV_TMP, 0700);
if (ret < 0 && errno != EEXIST) {
- warn("failed to create /tmp/tqftpserv");
+ warn("failed to create temporary tqftpserv directory");
return -1;
}
- base = open("/tmp/tqftpserv", O_RDONLY | O_DIRECTORY);
+ base = open(TQFTPSERV_TMP, O_RDONLY | O_DIRECTORY);
if (base < 0) {
- warn("failed top open /tmp/tqftpserv");
+ warn("failed top open temporary tqftpserv directory");
return -1;
}