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

Commit 022056c6 authored by Felipe Leme's avatar Felipe Leme Committed by android-build-merger
Browse files

Call _exit() instead of exit() on child failure.

am: baa85bd8

* commit 'baa85bd8':
  Call _exit() instead of exit() on child failure.

Change-Id: I7f78e1f2550cf58467c1a191b8a0c9668277ad1d
parents ab864913 baa85bd8
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -201,7 +201,8 @@ static void dump_systrace() {
        execl("/system/bin/atrace", "/system/bin/atrace", "--async_dump", nullptr);
        // execl should never return, but if it did, we need to exit.
        MYLOGD("execl on '/system/bin/atrace --async_dump' failed: %s", strerror(errno));
        exit(EXIT_FAILURE);
        // Must call _exit (instead of exit), otherwise it will corrupt the zip file.
        _exit(EXIT_FAILURE);
    } else {
        close(pipefd[1]);  // close the write end of the pipe in the parent
        add_zip_entry_from_fd("systrace.txt", pipefd[0]); // write output to zip file
+2 −1
Original line number Diff line number Diff line
@@ -747,7 +747,8 @@ int run_command_always(const char *title, bool drop_root, int timeout_seconds, c
        // it's safer to exit dumpstate.
        MYLOGD("execvp on command '%s' failed (error: %s)", command, strerror(errno));
        fflush(stdout);
        exit(EXIT_FAILURE);
        // Must call _exit (instead of exit), otherwise it will corrupt the zip file.
        _exit(EXIT_FAILURE);
    }

    /* handle parent case */