From f0a54c17d894391a69bfa6c11b474c5b851b762e Mon Sep 17 00:00:00 2001 From: Andreas Gampe Date: Mon, 24 Nov 2014 19:31:40 -0800 Subject: [PATCH] Libion: Remove unused variables For build-system CFLAGS clean-up, fix unused variables. Fix missing close of file descriptors. Explicitly exit after a fork. Change-Id: I76affbc8647c3a760ed3cacc7f3ada3f59e283b1 --- libion/ion.c | 1 - libion/ion_test.c | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/libion/ion.c b/libion/ion.c index 80bdc2abc..a79525dc8 100644 --- a/libion/ion.c +++ b/libion/ion.c @@ -117,7 +117,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 887228283..b7d558354 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); } }