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

Commit 121a11cf authored by Steven Moreland's avatar Steven Moreland Committed by Android (Google) Code Review
Browse files

Merge "copyInternalSpliceSocket - close in finally block" into main

parents 87afa9f9 c1a6df55
Loading
Loading
Loading
Loading
+59 −59
Original line number Diff line number Diff line
@@ -547,7 +547,7 @@ public final class FileUtils {
        long t;

        FileDescriptor[] pipes = Os.pipe();

        try {
            while (countToRead > 0 || countInPipe > 0) {
                if (countToRead > 0) {
                    t = Os.splice(in, null, pipes[1], null, Math.min(countToRead, COPY_CHECKPOINT_BYTES),
@@ -582,8 +582,6 @@ public final class FileUtils {
                            ", copied:" + progress +
                            ", read:" + (count - countToRead) +
                            ", in pipe: " + countInPipe);
                    Os.close(pipes[0]);
                    Os.close(pipes[1]);
                        throw new ErrnoException("splice, pipe --> fdOut", EIO);
                    } else {
                        progress += t;
@@ -611,8 +609,10 @@ public final class FileUtils {
                    listener.onProgress(progressSnapshot);
                });
            }
        } finally {
            Os.close(pipes[0]);
            Os.close(pipes[1]);
        }
        return progress;
    }