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

Commit b2d935c4 authored by Tomasz Wasilczyk's avatar Tomasz Wasilczyk
Browse files

libshmem: don't depend on unique_fd cast to int

Bug: 302723053
Test: m libshmemcompat
Change-Id: I862e726ca3fa22b1f16a3d718a80d3a035fe129c
parent 6965d391
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -84,11 +84,11 @@ bool convertIMemoryToSharedFileRegion(const sp<IMemory>& mem,
            return false;
        }

        const int fd = fcntl(heap->getHeapID(), F_DUPFD_CLOEXEC, 0);
        if (fd < 0) {
        base::unique_fd fd(fcntl(heap->getHeapID(), F_DUPFD_CLOEXEC, 0));
        if (!fd.ok()) {
            return false;
        }
        result->fd.reset(base::unique_fd(fd));
        result->fd.reset(std::move(fd));
        result->size = size;
        result->offset = heap->getOffset() + offset;
        result->writeable = (heap->getFlags() & IMemoryHeap::READ_ONLY) == 0;