dragonboards: sync up vendor userspace daemons to upstream sources

Sync up the vendor userspace daemons, used to bring
up the remoteprocs, to their upstream sources.

The following projects are being synced up to the
associated upstream commit IDs.

https://github.com/andersson/pd-mapper
9d78fc0c6143 (pd-mapper: Null terminate firmware_value string")

https://github.com/andersson/qrtr
commit 9dc7a88548c2 ("libqrtr: Zero-initialize sockaddr_qrtr")
Note: Dropped qrtr changes from commit
      47e48a8d935b ("Android: Disable "treat warnings as errors".")
      https://github.com/andersson/qrtr/commit/47e48a8d935b

https://github.com/andersson/rmtfs
695d0668ffa6 ("storage: fix out of bounds read")

https://github.com/andersson/tqftpserv
783425b550de ("ANDROID: Add Android.bp makefile")

Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
Change-Id: Ic08ccff151c012f17e2dfe9529a91b2d1931df57
diff --git a/qcom/rmtfs/rmtfs.c b/qcom/rmtfs/rmtfs.c
index 93965f1..b3ed289 100644
--- a/qcom/rmtfs/rmtfs.c
+++ b/qcom/rmtfs/rmtfs.c
@@ -220,6 +220,10 @@
 respond:
 	dbgprintf("[RMTFS] iovec %d, %sforced => (%d:%d)\n", caller_id, force ? "" : "not ",
 							     resp.result.result, resp.result.error);
+
+	if (is_write)
+		storage_sync(rmtfd);
+
 	for (i = 0; i < num_entries; i++) {
 		dbgprintf("[RMTFS]       %s %d:%d 0x%x\n", is_write ? "write" : "read",
 							   entries[i].sector_addr,
@@ -445,7 +449,10 @@
 		rproc_start();
 
 	for (;;) {
-		if (rprocfd >= 0 && sig_int_count == 1 && !sig_int_handled) {
+		if (sig_int_count == 1 && !sig_int_handled) {
+			if (rprocfd < 0)
+				break;
+
 			rproc_stop();
 			sig_int_handled = true;
 		} else if (sig_int_count > 1) {