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

Commit 37293894 authored by Primiano Tucci's avatar Primiano Tucci
Browse files

DropboxManager: Add err message if passing an invalid fd to addFile()

Follow up to I076bfd3180fb9b4baff7e1bae2e611419061b2a7. Adds an
error message if passing -1 to addFile(int fd)

Change-Id: I73a8d88f12b14bc28ea3bc3782a9df7d96d53c92
Test: builds
parent 65609651
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -185,6 +185,11 @@ DropBoxManager::addFile(const String16& tag, const string& filename, int flags)
Status
DropBoxManager::addFile(const String16& tag, int fd, int flags)
{
    if (fd == -1) {
        string message("invalid fd (-1) passed to to addFile");
        ALOGW("DropboxManager: %s", message.c_str());
        return Status::fromExceptionCode(Status::EX_ILLEGAL_STATE, message.c_str());
    }
    Entry entry(tag, flags, fd);
    return add(entry);
}
@@ -201,4 +206,3 @@ DropBoxManager::add(const Entry& entry)
}

}} // namespace android::os