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

Commit 0f2097c0 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Don't use TEMP_FAILURE_RETRY on close()"

parents cada8d74 3d118e72
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -115,7 +115,7 @@ bool ForkExecveAndWaitForCompletion(const char* filename, char* const argv[]) {
        // fork succeeded -- this is executing in the child process

        // Close the pipe FD not used by this process
        TEMP_FAILURE_RETRY(close(pipe_fds[0]));
        close(pipe_fds[0]);

        // Redirect stderr to the pipe FD provided by the parent
        if (TEMP_FAILURE_RETRY(dup2(pipe_fds[1], STDERR_FILENO)) == -1) {
@@ -123,7 +123,7 @@ bool ForkExecveAndWaitForCompletion(const char* filename, char* const argv[]) {
            _exit(127);
            return false;
        }
        TEMP_FAILURE_RETRY(close(pipe_fds[1]));
        close(pipe_fds[1]);

        if (execv(filename, argv) == -1) {
            PLOG(ERROR) << "Failed to execve " << filename;
@@ -137,7 +137,7 @@ bool ForkExecveAndWaitForCompletion(const char* filename, char* const argv[]) {
        // fork succeeded -- this is executing in the original/parent process

        // Close the pipe FD not used by this process
        TEMP_FAILURE_RETRY(close(pipe_fds[1]));
        close(pipe_fds[1]);

        // Log the redirected output of the child process.
        // It's unfortunate that there's no standard way to obtain an istream for a file descriptor.
@@ -148,7 +148,7 @@ bool ForkExecveAndWaitForCompletion(const char* filename, char* const argv[]) {
        if (!android::base::ReadFdToString(child_out_fd, &child_output)) {
            PLOG(ERROR) << "Failed to capture full output of " << filename;
        }
        TEMP_FAILURE_RETRY(close(child_out_fd));
        close(child_out_fd);
        if (!child_output.empty()) {
            // Log captured output, line by line, because LOG expects to be invoked for each line
            std::istringstream in(child_output);
+3 −3
Original line number Diff line number Diff line
@@ -105,7 +105,7 @@ bool LogTags::RebuildFileEventLogTags(const char* filename, bool warn) {
                android::base::WriteStringToFd(
                    formatEntry_locked(it.first, AID_ROOT), fd);
            }
            TEMP_FAILURE_RETRY(close(fd));
            close(fd);
        }
    }

@@ -601,7 +601,7 @@ void LogTags::WriteDynamicEventLogTags(uint32_t tag, uid_t uid) {

    std::string ret = formatEntry_locked(tag, uid, false);
    android::base::WriteStringToFd(ret, fd);
    TEMP_FAILURE_RETRY(close(fd));
    close(fd);

    size_t size = 0;
    file2watermark_const_iterator iwater;
@@ -625,7 +625,7 @@ void LogTags::WriteDebugEventLogTags(uint32_t tag, uid_t uid) {

    std::string ret = formatEntry_locked(tag, uid, false);
    android::base::WriteStringToFd(ret, fd);
    TEMP_FAILURE_RETRY(close(fd));
    close(fd);

    size_t size = 0;
    file2watermark_const_iterator iwater;