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

Commit d449e2e5 authored by Yifan Hong's avatar Yifan Hong
Browse files

libdm: remove libbase dependency in header.

libbase logging macros conflicts with libchrome's logging macros.
Test: compiles

Change-Id: I02697baa87c1466caf2e4ef58b0c8b2635982527
parent 5f42ee18
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -20,11 +20,19 @@
#include <sys/sysmacros.h>
#include <sys/types.h>

#include <android-base/logging.h>
#include <android-base/macros.h>

namespace android {
namespace dm {

DeviceMapper::DeviceMapper() : fd_(-1) {
    fd_ = TEMP_FAILURE_RETRY(open("/dev/device-mapper", O_RDWR | O_CLOEXEC));
    if (fd_ < 0) {
        PLOG(ERROR) << "Failed to open device-mapper";
    }
}

DeviceMapper& DeviceMapper::Instance() {
    static DeviceMapper instance;
    return instance;
+1 −8
Original line number Diff line number Diff line
@@ -29,8 +29,6 @@
#include <utility>
#include <vector>

#include <android-base/logging.h>

#include "dm_table.h"

// The minimum expected device mapper major.minor version
@@ -144,12 +142,7 @@ class DeviceMapper final {

    void InitIo(struct dm_ioctl* io, const std::string& name = std::string()) const;

    DeviceMapper() : fd_(-1) {
        fd_ = TEMP_FAILURE_RETRY(open("/dev/device-mapper", O_RDWR | O_CLOEXEC));
        if (fd_ < 0) {
            PLOG(ERROR) << "Failed to open device-mapper";
        }
    }
    DeviceMapper();

    // Creates a device mapper device with given name.
    // Return 'true' on success and 'false' on failure to
+0 −2
Original line number Diff line number Diff line
@@ -23,8 +23,6 @@
#include <string>
#include <vector>

#include <android-base/logging.h>

namespace android {
namespace dm {

+1 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@
#include <sys/types.h>
#include <unistd.h>

#include <android-base/logging.h>
#include <android-base/parseint.h>
#include <android-base/unique_fd.h>
#include <libdm/dm.h>