Merge "sharedmem.cpp: replace dup() with fcntl(F_DUPFD_CLOEXEC)"

This commit is contained in:
Treehugger Robot
2019-01-15 03:13:21 +00:00
committed by Gerrit Code Review

View File

@@ -71,7 +71,7 @@ int ASharedMemory_dupFromJava(JNIEnv* env, jobject javaSharedMemory) {
} }
int fd = env->CallIntMethod(javaSharedMemory, sSharedMemory.getFd); int fd = env->CallIntMethod(javaSharedMemory, sSharedMemory.getFd);
if (fd != -1) { if (fd != -1) {
fd = dup(fd); fd = fcntl(fd, F_DUPFD_CLOEXEC, 0);
} }
return fd; return fd;
} }