From 3321ea333418eabd510ecabdd17e56d6d03af082 Mon Sep 17 00:00:00 2001 From: XUranus <2257238649wdx@gmail.com> Date: Sat, 30 Dec 2023 20:40:29 +0800 Subject: [PATCH] fix windows compile --- cli/vbackup.cpp | 3 +-- src/native/linux/LinuxMountUtils.cpp | 7 ++++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/cli/vbackup.cpp b/cli/vbackup.cpp index fe5c7c5..58fb9d9 100644 --- a/cli/vbackup.cpp +++ b/cli/vbackup.cpp @@ -110,7 +110,7 @@ static CliArgs ParseCliArgs(int argc, const char** argv) GetOptionResult result = GetOption( argv + 1, argc - 1, "v:n:f:d:m:k:p:h:r:l:", - {"--volume=", "--name=", "--format=", "--data=", "--meta=", "--checkpoint=" + {"--volume=", "--name=", "--format=", "--data=", "--meta=", "--checkpoint=", "--prevmeta=", "--help", "--restore", "--loglevel="}); for (const OptionResult opt: result.opts) { if (opt.option == "v" || opt.option == "volume") { @@ -196,7 +196,6 @@ void InitLogger(const CliArgs& cliArgs) #else conf.logDirPath = "/tmp/LoggerTest"; #endif - Logger::GetInstance()->SetLogLevel(LoggerLevel::DEBUG); if (!Logger::GetInstance()->Init(conf)) { std::cerr << "Init logger failed" << std::endl; } diff --git a/src/native/linux/LinuxMountUtils.cpp b/src/native/linux/LinuxMountUtils.cpp index 2bd4580..f09d930 100644 --- a/src/native/linux/LinuxMountUtils.cpp +++ b/src/native/linux/LinuxMountUtils.cpp @@ -4,6 +4,8 @@ * https://android.googlesource.com/platform/system/core/+/jb-mr1.1-dev-plus-aosp/toolbox/mount.c */ +#ifdef __linux__ + #include #include #include @@ -322,6 +324,7 @@ bool linuxmountutil::Umount(const std::string& mountTargetPath, bool force) ::umount2(mountTargetPath.c_str(), flags) != 0) { return false; } + return true; } bool linuxmountutil::IsMountPoint(const std::string& dirPath) @@ -362,4 +365,6 @@ std::string linuxmountutil::GetMountDevicePath(const std::string& mountTargetPat } ::endmntent(mountsFile); return devicePath; -} \ No newline at end of file +} + +#endif \ No newline at end of file