!395 增加获取打印机列表维测信息

Merge pull request !395 from 吴叙/master
This commit is contained in:
openharmony_ci 2024-10-06 03:56:07 +00:00 committed by Gitee
commit c57fb09756
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
4 changed files with 7 additions and 7 deletions

View File

@ -209,7 +209,7 @@ int32_t PrintCupsClient::StartCupsdService()
}
char realPidFile[PATH_MAX] = {};
if (realpath(pidFile.c_str(), realPidFile) == nullptr) {
PRINT_HILOGE("The realPidFile is null.");
PRINT_HILOGE("The realPidFile is null, errno:%{public}s", std::to_string(errno).c_str());
return E_PRINT_SERVER_FAILURE;
}
int fd;
@ -341,7 +341,7 @@ void PrintCupsClient::CopyDirectory(const char *srcDir, const char *destDir)
char destSrc[PATH_MAX] = {};
if (realpath(srcFilePath.c_str(), realSrc) == nullptr ||
realpath(destDir, destSrc) == nullptr) {
PRINT_HILOGE("The realSrc is null.");
PRINT_HILOGE("The realSrc is null, errno:%{public}s", std::to_string(errno).c_str());
continue;
}
FILE *srcFile = fopen(realSrc, "rb");
@ -938,7 +938,7 @@ ppd_file_t* PrintCupsClient::GetPPDFile(const std::string &printerName)
PRINT_HILOGI("GetPPDFile started filePath %{public}s", filePath.c_str());
char realPath[PATH_MAX] = {};
if (realpath(filePath.c_str(), realPath) == nullptr) {
PRINT_HILOGE("The realPidFile is null.");
PRINT_HILOGE("The realPidFile is null, errno:%{public}s", std::to_string(errno).c_str());
return nullptr;
}
int fd;

View File

@ -984,7 +984,7 @@ bool PrintServiceAbility::WritePreferenceToFile()
char realPidFile[PATH_MAX] = {};
std::string printerPreferenceFilePath = PRINTER_SERVICE_FILE_PATH + "/" + PRINTER_PREFERENCE_FILE;
if (realpath(PRINTER_SERVICE_FILE_PATH.c_str(), realPidFile) == nullptr) {
PRINT_HILOGE("The realPidFile is null.");
PRINT_HILOGE("The realPidFile is null, errno:%{public}s", std::to_string(errno).c_str());
return false;
}
int32_t fd = open(printerPreferenceFilePath.c_str(), O_CREAT | O_TRUNC | O_RDWR, 0640);

View File

@ -181,7 +181,7 @@ bool PrintSystemData::SaveCupsPrinterMap()
std::string printerListFilePath = PRINTER_SERVICE_FILE_PATH + "/" + PRINTER_LIST_FILE;
char realPidFile[PATH_MAX] = {};
if (realpath(PRINTER_SERVICE_FILE_PATH.c_str(), realPidFile) == nullptr) {
PRINT_HILOGE("The realPidFile is null.");
PRINT_HILOGE("The realPidFile is null, errno:%{public}s", std::to_string(errno).c_str());
return E_PRINT_SERVER_FAILURE;
}
int32_t fd = open(printerListFilePath.c_str(), O_CREAT | O_TRUNC | O_RDWR, 0640);

View File

@ -309,7 +309,7 @@ bool PrintUserData::GetFileData(std::string &fileData)
PRINT_HILOGW("open printer list file fail");
char realPidFile[PATH_MAX] = {};
if (realpath(PRINTER_SERVICE_FILE_PATH.c_str(), realPidFile) == nullptr) {
PRINT_HILOGE("The realPidFile is null.");
PRINT_HILOGE("The realPidFile is null, errno:%{public}s", std::to_string(errno).c_str());
return E_PRINT_SERVER_FAILURE;
}
int32_t fd = open(userDataFilePath.c_str(), O_CREAT | O_TRUNC | O_RDWR, 0640);
@ -360,7 +360,7 @@ bool PrintUserData::SetUserDataToFile()
char realPidFile[PATH_MAX] = {};
std::string userDataFilePath = PRINTER_SERVICE_FILE_PATH + "/" + PRINT_USER_DATA_FILE;
if (realpath(PRINTER_SERVICE_FILE_PATH.c_str(), realPidFile) == nullptr) {
PRINT_HILOGE("The realPidFile is null.");
PRINT_HILOGE("The realPidFile is null, errno:%{public}s", std::to_string(errno).c_str());
return E_PRINT_SERVER_FAILURE;
}
int32_t fd = open(userDataFilePath.c_str(), O_CREAT | O_TRUNC | O_RDWR, 0640);