diff options
Diffstat (limited to 'libion')
-rw-r--r-- | libion/ion.c | 2 | ||||
-rw-r--r-- | libion/ion_test.c | 4 | ||||
-rw-r--r-- | libion/tests/Android.mk | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/libion/ion.c b/libion/ion.c index 80bdc2a..4908932 100644 --- a/libion/ion.c +++ b/libion/ion.c @@ -23,6 +23,7 @@ #include <errno.h> #include <fcntl.h> #include <stdio.h> +#include <string.h> #include <sys/ioctl.h> #include <sys/mman.h> #include <sys/types.h> @@ -117,7 +118,6 @@ int ion_map(int fd, ion_user_handle_t handle, size_t length, int prot, int ion_share(int fd, ion_user_handle_t handle, int *share_fd) { - int map_fd; int ret; struct ion_fd_data data = { .handle = handle, diff --git a/libion/ion_test.c b/libion/ion_test.c index 8872282..b7d5583 100644 --- a/libion/ion_test.c +++ b/libion/ion_test.c @@ -164,8 +164,9 @@ void ion_share_test() printf("master->master? [%10s]\n", ptr); if (recvmsg(sd[0], &msg, 0) < 0) perror("master recv 1"); + close(fd); + _exit(0); } else { - struct msghdr msg; struct cmsghdr *cmsg; char* ptr; int fd, recv_fd; @@ -205,6 +206,7 @@ void ion_share_test() strcpy(ptr, "child"); printf("child sending msg 2\n"); sendmsg(sd[1], &child_msg, 0); + close(fd); } } diff --git a/libion/tests/Android.mk b/libion/tests/Android.mk index 8dc7f9d..894f90e 100644 --- a/libion/tests/Android.mk +++ b/libion/tests/Android.mk @@ -18,10 +18,8 @@ LOCAL_PATH:= $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := ion-unit-tests -LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk LOCAL_CFLAGS += -g -Wall -Werror -std=gnu++11 -Wno-missing-field-initializers LOCAL_SHARED_LIBRARIES += libion -LOCAL_STATIC_LIBRARIES += libgtest_main LOCAL_C_INCLUDES := $(LOCAL_PATH)/../kernel-headers LOCAL_SRC_FILES := \ ion_test_fixture.cpp \ |