!1460 增加ntfs修复能力

Merge pull request !1460 from sunxiaoqiang/master
This commit is contained in:
openharmony_ci 2024-11-02 03:49:59 +00:00 committed by Gitee
commit 73e3009a53
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -296,12 +296,18 @@ int32_t ExternalVolumeInfo::DoSetVolDesc(std::string description)
{
int32_t err = 0;
if (fsType_ == "ntfs") {
std::vector<std::string> cmd = {
std::vector<std::string> fixCmd = {
"ntfsfix",
"-d",
devPath_
};
err = ForkExec(fixCmd);
std::vector<std::string> labelCmd = {
"ntfslabel",
devPath_,
description
};
err = ForkExec(cmd);
err = ForkExec(labelCmd);
} else if (fsType_ == "exfat") {
std::vector<std::string> cmd = {
"exfatlabel",