diff options
Diffstat (limited to 'libs/utils/Parcel.cpp')
-rw-r--r-- | libs/utils/Parcel.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/libs/utils/Parcel.cpp b/libs/utils/Parcel.cpp index 2962b25aea..4225e67283 100644 --- a/libs/utils/Parcel.cpp +++ b/libs/utils/Parcel.cpp @@ -658,15 +658,20 @@ status_t Parcel::writeNativeHandle(const native_handle& handle) status_t err; err = writeInt32(handle.numFds); if (err != NO_ERROR) return err; - + err = writeInt32(handle.numInts); if (err != NO_ERROR) return err; - + for (int i=0 ; err==NO_ERROR && i<handle.numFds ; i++) err = writeDupFileDescriptor(handle.data[i]); - + + if (err != NO_ERROR) { + LOGD("write native handle, write dup fd failed"); + return err; + } + err = write(handle.data + handle.numFds, sizeof(int)*handle.numInts); - + return err; } |