diff options
author | Yifan Hong <elsk@google.com> | 2018-08-16 09:36:45 -0700 |
---|---|---|
committer | Yifan Hong <elsk@google.com> | 2018-08-16 11:12:36 -0700 |
commit | d449e2e59ff34a0cde666126630644c9e6b6a369 (patch) | |
tree | 77fb23918a89e3b7f712c6ff43fa42769c6797a7 /fs_mgr/libdm | |
parent | 5f42ee186dd78435d78d7ee757de9c2f25c5783f (diff) | |
download | system_core-d449e2e59ff34a0cde666126630644c9e6b6a369.tar.gz system_core-d449e2e59ff34a0cde666126630644c9e6b6a369.tar.bz2 system_core-d449e2e59ff34a0cde666126630644c9e6b6a369.zip |
libdm: remove libbase dependency in header.
libbase logging macros conflicts with libchrome's logging macros.
Test: compiles
Change-Id: I02697baa87c1466caf2e4ef58b0c8b2635982527
Diffstat (limited to 'fs_mgr/libdm')
-rw-r--r-- | fs_mgr/libdm/dm.cpp | 8 | ||||
-rw-r--r-- | fs_mgr/libdm/include/libdm/dm.h | 9 | ||||
-rw-r--r-- | fs_mgr/libdm/include/libdm/dm_target.h | 2 |
3 files changed, 9 insertions, 10 deletions
diff --git a/fs_mgr/libdm/dm.cpp b/fs_mgr/libdm/dm.cpp index ad3b6f446..8bcbec2c9 100644 --- a/fs_mgr/libdm/dm.cpp +++ b/fs_mgr/libdm/dm.cpp @@ -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; diff --git a/fs_mgr/libdm/include/libdm/dm.h b/fs_mgr/libdm/include/libdm/dm.h index e2bc729f8..9b61ddcec 100644 --- a/fs_mgr/libdm/include/libdm/dm.h +++ b/fs_mgr/libdm/include/libdm/dm.h @@ -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 diff --git a/fs_mgr/libdm/include/libdm/dm_target.h b/fs_mgr/libdm/include/libdm/dm_target.h index 31863c8fa..aab89e5f0 100644 --- a/fs_mgr/libdm/include/libdm/dm_target.h +++ b/fs_mgr/libdm/include/libdm/dm_target.h @@ -23,8 +23,6 @@ #include <string> #include <vector> -#include <android-base/logging.h> - namespace android { namespace dm { |