jianhan-he commented on a change in pull request #2854: Feature/try fix top
native crash fd problem
URL: https://github.com/apache/incubator-weex/pull/2854#discussion_r318426856
##########
File path: weex_core/Source/android/multiprocess/weex_js_connection.cpp
##########
@@ -617,3 +602,43 @@ int copyFile(const char *SourceFile, const char *NewFile)
{
return 1;
}
}
+
+void *WeexConnInfo::mmap_for_ipc() {
+ pid_t pid = getpid();
+ std::string clientName(this->is_client ? "WEEX_IPC_CLIENT" :
"WEEX_IPC_SERVER");
+ clientName += std::to_string(pid);
+ int fd = -1;
+ int initTimes = 1;
+ void *base = MAP_FAILED;
+ do {
+ fd = ashmem_create_region(clientName.c_str(), IPCFutexPageQueue::ipc_size);
+ if (-1 == fd) {
+ if (this->is_client) {
+ throw IPCException("failed to create ashmem region: %s",
strerror(errno));
+ } else {
+ LOGE("failed to create ashmem region: %s", strerror(errno))
Review comment:
add return base
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services