diff options
author | Mathias Agopian <mathias@google.com> | 2009-05-02 00:06:41 -0700 |
---|---|---|
committer | Mathias Agopian <mathias@google.com> | 2009-05-02 00:06:41 -0700 |
commit | 8cd81ab3f2a446837bd267b6e48ac7231c2f16bb (patch) | |
tree | 2ce232dcbf4412330427b417e4ac475e8f2b47ab /libcutils | |
parent | f31371145037fc1e8c794370bdcaab331214176e (diff) | |
download | system_core-8cd81ab3f2a446837bd267b6e48ac7231c2f16bb.zip system_core-8cd81ab3f2a446837bd267b6e48ac7231c2f16bb.tar.gz system_core-8cd81ab3f2a446837bd267b6e48ac7231c2f16bb.tar.bz2 |
get rid of native_handle_{dup|copy} since they were not used any longer
Diffstat (limited to 'libcutils')
-rw-r--r-- | libcutils/native_handle.c | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/libcutils/native_handle.c b/libcutils/native_handle.c index 47f6950..842e1ed 100644 --- a/libcutils/native_handle.c +++ b/libcutils/native_handle.c @@ -46,37 +46,6 @@ int native_handle_delete(native_handle* h) return 0; } -int native_handle_dup(native_handle* lhs, native_handle const* rhs) -{ - if (rhs->version != sizeof(native_handle)) - return -EINVAL; - - if (lhs->version != sizeof(native_handle)) - return -EINVAL; - - const int numFds = rhs->numFds; - const int numInts = rhs->numInts; - - if (lhs->numFds == 0 && lhs->numInts == 0) { - lhs->numFds = numFds; - lhs->numInts = numInts; - return 0; - } - - if (lhs->numFds != numFds) - return -EINVAL; - - if (lhs->numInts != numInts) - return -EINVAL; - - int i; - for (i=0 ; i<numFds ; i++) { - lhs->data[i] = dup( rhs->data[i] ); - } - memcpy(&lhs->data[i], &rhs->data[i], numInts*sizeof(int)); - return 0; -} - int native_handle_close(const native_handle* h) { if (h->version != sizeof(native_handle)) @@ -89,16 +58,3 @@ int native_handle_close(const native_handle* h) } return 0; } - -native_handle* native_handle_copy(const native_handle* rhs) -{ - if (rhs == 0) - return 0; - - native_handle* lhs = native_handle_create(rhs->numFds, rhs->numInts); - if (native_handle_dup(lhs, rhs) < 0) { - native_handle_delete(lhs); - lhs = 0; - } - return lhs; -} |