From: Erik Kline Date: Thu, 24 Aug 2017 05:21:57 +0000 (-0700) Subject: switch to native_handle_create() for passing ownership X-Git-Tag: android-x86-8.1-r1~101^2^2 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=bee00acce26666301609eedd5b87ea359e474c87;p=android-x86%2Fframeworks-base.git switch to native_handle_create() for passing ownership Test: builds Bug: 29337859 Bug: 32163131 Bug: 64976634 Change-Id: Ifd064736c9fcb633b72e56e93b7baa5f4a5ff051 --- diff --git a/services/core/jni/com_android_server_connectivity_tethering_OffloadHardwareInterface.cpp b/services/core/jni/com_android_server_connectivity_tethering_OffloadHardwareInterface.cpp index 87312f82d58a..f9cbd1601290 100644 --- a/services/core/jni/com_android_server_connectivity_tethering_OffloadHardwareInterface.cpp +++ b/services/core/jni/com_android_server_connectivity_tethering_OffloadHardwareInterface.cpp @@ -74,10 +74,9 @@ int conntrackSocket(unsigned groups) { hidl_handle handleFromFileDescriptor(base::unique_fd fd) { hidl_handle h; - NATIVE_HANDLE_DECLARE_STORAGE(storage, 0, 0); static constexpr int kNumFds = 1; static constexpr int kNumInts = 0; - native_handle_t *nh = native_handle_init(storage, kNumFds, kNumInts); + native_handle_t *nh = native_handle_create(kNumFds, kNumInts); nh->data[0] = fd.release(); static constexpr bool kTakeOwnership = true;