Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit da048353 authored by Steven Moreland's avatar Steven Moreland
Browse files

binderLibTest: cleanup child processes on error

When this test errors, the child processes hang out in a zombie state in
do_exit, since they still have an open pipe from the parent process.

Bug: N/A
Test: binderLibTest
Change-Id: Icb07a155fc39fcb4c91b5c74297fe0d09f59e6b5
parent f2a15e87
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -30,6 +30,7 @@


#include <private/binder/binder_module.h>
#include <private/binder/binder_module.h>
#include <sys/epoll.h>
#include <sys/epoll.h>
#include <sys/prctl.h>


#define ARRAY_SIZE(array) (sizeof array / sizeof array[0])
#define ARRAY_SIZE(array) (sizeof array / sizeof array[0])


@@ -106,6 +107,7 @@ pid_t start_server_process(int arg2, bool usePoll = false)
    if (pid == -1)
    if (pid == -1)
        return pid;
        return pid;
    if (pid == 0) {
    if (pid == 0) {
        prctl(PR_SET_PDEATHSIG, SIGHUP);
        close(pipefd[0]);
        close(pipefd[0]);
        execv(binderservername, childargv);
        execv(binderservername, childargv);
        status = -errno;
        status = -errno;