mirror of
https://gitee.com/openharmony/print_print_fwk
synced 2024-11-26 18:40:40 +00:00
commit
c57fb09756
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user