|
@@ -406,12 +406,12 @@ bool SpEntityPrivilege::RecursiveCopyDir(const char *pszSourceDir, const char *p
|
|
|
|
|
|
ErrorCodeEnum SpEntityPrivilege::UpdateVerTxt(const char* strActiveFilePath, const char* toWriteVersionStr, bool toCheck)
|
|
|
{
|
|
|
- HANDLE hFile = ::CreateFileA(strActiveFilePath, GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
|
|
+ HANDLE hFile = ::CreateFileA(strActiveFilePath, GENERIC_WRITE, 0, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
|
|
|
BOOL bSetSucc = FALSE;
|
|
|
if (hFile == INVALID_HANDLE_VALUE)
|
|
|
{
|
|
|
- LogError(Severity_Low, Error_Unexpect, 0, "open active.txt fail");
|
|
|
- return Error_Unexpect;
|
|
|
+ LogError(Severity_Low, Error_Unexpect, 0, CSimpleStringA::Format("open %s failed! err=%u", strActiveFilePath, GetLastError()));
|
|
|
+ return Error_IO;
|
|
|
}
|
|
|
DWORD dwWrittenLen(0);
|
|
|
bSetSucc = WriteFile(hFile, toWriteVersionStr, strlen(toWriteVersionStr), &dwWrittenLen, NULL);
|
|
@@ -1005,9 +1005,11 @@ ErrorCodeEnum SpEntityPrivilege::RewriteDepVersion(const CSimpleStringA& strVers
|
|
|
|
|
|
rc = UpdateVerTxt(path, strVersion, true);
|
|
|
if (rc == Error_Succeed && bRefresh) {
|
|
|
+ //TODO: 调试专用,后移除 [Gifur@20241015]
|
|
|
DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("to refresh...");
|
|
|
rc = (ErrorCodeEnum)sp_dir_refresh_dep_path(dir);
|
|
|
if (rc == Error_Succeed) {
|
|
|
+ //TODO: 调试专用,后移除 [Gifur@20241015]
|
|
|
DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("to send fresh post");
|
|
|
iobuffer_t* pkt = iobuffer_create(-1, -1);
|
|
|
rc = PostInfoShell(SHELL_CMD_INFO_REFRESH_ENV, &pkt);
|