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

This commit is contained in:
Treehugger Robot
2019-01-15 05:47:42 +00:00
committed by Gerrit Code Review

View File

@@ -1095,7 +1095,7 @@ static jobject Bitmap_createFromParcel(JNIEnv* env, jobject, jobject parcel) {
#endif #endif
// Dup the file descriptor so we can keep a reference to it after the Parcel // Dup the file descriptor so we can keep a reference to it after the Parcel
// is disposed. // is disposed.
int dupFd = dup(blob.fd()); int dupFd = fcntl(blob.fd(), F_DUPFD_CLOEXEC, 0);
if (dupFd < 0) { if (dupFd < 0) {
ALOGE("Error allocating dup fd. Error:%d", errno); ALOGE("Error allocating dup fd. Error:%d", errno);
blob.release(); blob.release();