Преглед изворни кода

Z991239-6443 #comment 一些列改动逐个验证

80374374 пре 1 месец
родитељ
комит
06f549d8dc

+ 9 - 0
Framework/libtoolkit/fileutil.c

@@ -14,6 +14,7 @@
 #include <sys/types.h>
 #include <dirent.h>
 #include <sys/stat.h>
+#include <fcntl.h>
 #endif
 
 #include "array.h"
@@ -56,6 +57,14 @@ TOOLKIT_API DWORD ReadFileSize(LPCSTR pszFile)
 	return fileSize;
 }
 
+TOOLKIT_API void SureUnixFileAttributeAccessable(LPCSTR pszFile)
+{
+#ifndef _MSC_VER
+	mode_t f_attrib = S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IWGRP | S_IXGRP | S_IROTH | S_IXOTH | S_IWOTH;
+	chmod(pszFile, f_attrib);
+#endif
+}
+
 TOOLKIT_API BOOL CreateDirA(LPCSTR lpDirPath, BOOL bRecursive)
 {
 	char* slashPos = NULL;

+ 2 - 0
Framework/libtoolkit/fileutil.h

@@ -26,6 +26,8 @@ TOOLKIT_API BOOL ExistsFileA(LPCSTR lpFilePath);
 #define ExistsFile ExistsFileA
 
 TOOLKIT_API DWORD ReadFileSize(LPCSTR pszFile);
+TOOLKIT_API void SureUnixFileAttributeAccessable(LPCSTR pszFile);
+
 
 TOOLKIT_API BOOL RemoveFileA(LPCSTR pszFile);
 TOOLKIT_API BOOL RemoveFileReadOnlyAttributeA(LPCSTR pszFile);

+ 0 - 4
Framework/libtoolkit/strutil.h

@@ -110,10 +110,6 @@ TOOLKIT_API char* strdupa(const char* str);
  */
 TOOLKIT_API char *strndup(const char *str, int n);
 
-#else 
-
-#define _strnicmp strncasecmp
-
 #endif //_WIN32
 
 /**

+ 0 - 4
Framework/spbase/SpEntity.cpp

@@ -2377,8 +2377,6 @@ ErrorCodeEnum SpEntity::RedirectSubscribBroadcast(CUUID SubID, const char *pszSu
 ErrorCodeEnum SpEntity::AskShell(int call_type, iobuffer_t **req_pkt, iobuffer_t **ans_pkt)
 {
 	ErrorCodeEnum Error;
-	iobuffer_t *r_pkt = NULL;
-
 	if (!req_pkt || !*req_pkt || !ans_pkt)
 		return Error_Param;
 	if (*ans_pkt)
@@ -2410,8 +2408,6 @@ ErrorCodeEnum SpEntity::AskShell(int call_type, iobuffer_t **req_pkt, iobuffer_t
 ErrorCodeEnum SpEntity::AskEntityByRPC(const char *pszEntityName, int call_type, iobuffer_t **req_pkt, iobuffer_t **ans_pkt)
 {
 	ErrorCodeEnum Error;
-	iobuffer_t *r_pkt = NULL;
-
 	if (!req_pkt || !*req_pkt || !ans_pkt)
 		return Error_Param;
 	if (*ans_pkt)

+ 0 - 1
Framework/spbase/SpEntityPrivilege.cpp

@@ -666,7 +666,6 @@ ErrorCodeEnum SpEntityPrivilege::RewriteDepVersion(const CSimpleStringA& strVers
 {
 	ErrorCodeEnum rc(Error_Succeed);
 	auto dir = sp_get_env()->dir;
-	auto cfg = sp_get_env()->cfg;
 	
 	if (dir == NULL)
 		return Error_Null;

+ 0 - 1
Framework/spbase/SpMisc.cpp

@@ -134,7 +134,6 @@ CUUID CUUID::Create(const CUUID &LastUUID)
 	TOOLKIT_ASSERT(getEntityResource()->m_gAppID != 0);
 #endif //_WIN32
 	CUUID t(0);
-	int repeat = 0;
 #ifdef _WIN32
 	t.m_nAppID = getEntityResource()->m_gAppID;
 #else

+ 0 - 3
Framework/spbase/sp_cfg.cpp

@@ -1794,9 +1794,7 @@ static int load_entity_list_byHttp(sp_cfg_shell_ini_t* shell, array_header_t** a
 	for (auto it = startupArr.begin(); it != startupArr.end(); it++)
 	{
 		std::string startupEntity = it->second;
-		sp_cfg_shell_entity_t* ent = find_entity(shell, startupEntity.c_str());
 		char* s = _strdup(startupEntity.c_str());
-		char* cmdline = strchr(s, ' ');
 		if (s) {
 			if (strlen(s)) {
 				int numargs, numchars;
@@ -2126,7 +2124,6 @@ ErrorCodeEnum init_shell_byHttp(sp_dir_t* dir, sp_cfg_shell_ini_t* shell, sp_cfg
 		char* value;
 		char* name;
 		char* context = NULL;
-		array_header_t* t = NULL;
 
 		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("override start entity list!");
 

+ 3 - 18
Module/mod_ResourceWatcher/mod_ResourceWatcher.cpp

@@ -134,18 +134,6 @@ struct SogouRunVersionInfo
         }
         return installVer;
     }
-    //TODO: CrossPlaform  [Gifur@2025730]
-    //true: 普通调用版本输入法,false: SDK版本输入法
-    bool IsTSFVersion()
-    {
-#if defined(_MSC_VER)
-        CVersion standardVer = CVersion(2, 6, 1, 1967); //对比版本为2.6.1.1967
-#else
-        CVersion standardVer = CVersion(2, 6, 4, 355); //对比版本为2.4.6.355
-#endif //_MSC_VER
-
-        return (ConvertVersion() >= standardVer);
-    }
 };
 
 struct SogouInstallStateInfo
@@ -403,7 +391,7 @@ ErrorCodeEnum SetFileExecutePriviledge(LPCTSTR lpcszDirOrFilePath)
 #endif //RVC_OS_WIN
     return result;
 }
-//TODO: CrossPlaform  [Gifur@2025730]
+/** 特殊逻辑需要这样返回?  [Gifur@2025821]*/
 static int IsFileExists(const char* pfilename)
 {
     int iRet = -1;
@@ -800,7 +788,7 @@ void ResourceWatcherEntity::ChcekDiskFileSpace()
     }
 }
 
-//TODO: CrossPlaform 看是否转移到框架toolkit,太常用了  [Gifur@2025730]
+//TODO: CrossPlaform 采用 toolkit/osutil_terminate_related_process 接口  [Gifur@2025730]
 BOOL ResourceWatcherEntity::KillProcessFromName(const CSimpleStringA& strProcessName)
 {
 
@@ -882,7 +870,7 @@ ErrorCodeEnum ResourceWatcherEntity::GetSogouPkgDirPath(CSimpleStringA& strPkgPa
 }
 #endif //RVC_OS_LINUX
 
-//TODO: CrossPlaform  [Gifur@2025730]
+//TODO: CrossPlaform  这段代码感觉像是拷贝的,待查 [Gifur@2025730]
 ErrorCodeEnum ResourceWatcherEntity::RunShellScript(LPCTSTR cmdline)
 {
 #if defined(RVC_OS_WIN)
@@ -1613,9 +1601,6 @@ void ResourceWatcherEntity::InstallSogou(SpReqAnsContext<ResourceWatcherService_
                         ctx->Ans.path = info.program.strInstallDir;
                         ctx->Ans.reserverd1 = info.program.strVersion;
                         ctx->Ans.reserverd2 = info.state.GetInstallTime().ToTimeString();
-                        //ctx->Ans.reserverd3 = info.program.IsTSFVersion() ? 1 : 0;
-                        //ctx->Ans.reserverd4 = 0;
-
                         if (doTryRestart) {
                             tmpMsg = CSimpleStringA::Format(" 从[%s]安装搜狗输入法成功。", strInstallPkgPath.GetData());
                         }

+ 8 - 88
Module/mod_SalesRecorder/mod_SalesRecorder.cpp

@@ -93,20 +93,10 @@ static void CStringSplit(char* str, char** result, const char* del)
 {
 	char* pdata = NULL;
 	char* p = NULL;
-	//TODO: CrossPlaform  [Gifur@2025730]
-#ifdef RVC_OS_WIN
 	p = strtok_s(str, del, &pdata);
-#else
-	p = strtok_r(str, del, &pdata);
-#endif // RVC_OS_WIN
-
 	while (p != NULL) {
 		*result++ = p;
-#ifdef RVC_OS_WIN
 		p = strtok_s(NULL, del, &pdata);
-#else
-		p = strtok_r(NULL, del, &pdata);
-#endif
 	}
 }
 
@@ -128,26 +118,6 @@ static bool rvcMoveFile(const char* strSrcFile, const char* strDstFile)
 	return bRet;
 }
 
-//TODO: CrossPlaform  [Gifur@2025728]
-static bool RvcDeleteFile(const char* strSrcFile)
-{
-	bool bRet = false;
-	if (NULL == strSrcFile) {
-		return bRet;
-	}
-
-#ifdef RVC_OS_WIN
-	bRet = DeleteFile(strSrcFile);
-#else
-	if (0 == remove(strSrcFile)) {
-		bRet = true;
-	}
-#endif // RVC_OS_WIN
-
-	return bRet;
-}
-
-
 #ifdef RVC_OS_WIN
 // 寻找某目录下与通配符匹配的文件
 static bool FindMatchedFile(const char* pstrFindPath, const char* pstrFindFileName, uint32_t & uCountFile)
@@ -267,36 +237,6 @@ static CSimpleStringA DecryptString(const char* lpszEncrpyted)
 	return CSimpleStringA((LPCTSTR)csPlainTxt);
 }
 
-//TODO: CrossPlaform  [Gifur@2025730]
-static unsigned long GetFileSize(const char* pfilename)
-{
-#ifdef RVC_OS_WIN
-	unsigned long usize = 0;
-	if (NULL == pfilename) {
-		return usize;
-	}
-
-	FILE* pFile = fopen(pfilename, "rb");
-	if (pFile) {
-		fseek(pFile, 0, SEEK_END);
-		usize = ftell(pFile);
-		fclose(pFile);
-	}
-
-	return usize;
-#else
-	struct stat statbuf;
-	if (0 == stat(pfilename, &statbuf)) {
-		return statbuf.st_size;
-	}
-	else {
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("errno info is %s.", strerror(errno));
-		return 0;
-	}
-#endif
-}
-
-
 static void rvcDbg(filecrypt_loglevel elevel, const char* fmt, ...)
 {
 	va_list arg;
@@ -824,15 +764,10 @@ void CSalesRecorderEntity::DeleteAllVideo( const char * pszVideoName)
 				{
 					fileName = CSimpleStringA::Format("%s%s_%d.%s", strPath.GetData(), strFindFileName.GetData(), i, RECORD_MP4_SUFFIX);
 
-					bRet = RvcDeleteFile(fileName.GetData());
+					bRet = RemoveFileA(fileName.GetData());
 					if(!bRet) {
 						bDeleteSucc = false;
-					#ifdef RVC_OS_WIN
-						DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Error Code %lu while delete %s.", GetLastError(), fileName.GetData());
-					#else
-						DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("%s(%d) while delete %s.", strerror(errno), errno, fileName.GetData());
-					#endif // RVC_OS_WIN
-						
+						DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("Error Code %lu while delete %s.", GetLastError(), fileName.GetData());
 					}
 				}
 				if (!bDeleteSucc) {
@@ -866,15 +801,10 @@ ErrorCodeEnum CSalesRecorderEntity::DeleteVideo( const char *videofilename)
 				{
 					fileName = CSimpleStringA::Format("%s%s_%d.%s", strPath.GetData(), videofilename, i, RECORD_MP4_SUFFIX);
 
-					bRet = RvcDeleteFile(fileName.GetData());
+					bRet = RemoveFileA(fileName.GetData());
 					if(!bRet) {
 						bDeleteSucc = false;
-						//TODO: CrossPlaform  [Gifur@2025730]
-					#ifdef RVC_OS_WIN
-						DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Error Code %lu while delete %s ", GetLastError(), fileName.GetData());
-					#else
-						DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("%s(%d) while delete %s ", strerror(errno), errno, fileName.GetData());
-					#endif
+						DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("Error Code %lu while delete %s ", GetLastError(), fileName.GetData());
 					}
 				}
 				if (!bDeleteSucc) {
@@ -942,7 +872,7 @@ ErrorCodeEnum CSalesRecorderEntity::SaveVideo( const char * videofilename)
 					{
 						sourFileName = CSimpleStringA::Format("%s%s_%d.%s", sourPath.GetData(), strFindFileName.GetData(), i, RECORD_MP4_SUFFIX);
 						destFileName = CSimpleStringA::Format("%s%s_%d.%s", destPath.GetData(), strFindFileName.GetData(), i, RECORD_MP4_SUFFIX);
-						unsigned long ufilesize = GetFileSize(sourFileName.GetData());
+						unsigned long ufilesize = ReadFileSize(sourFileName.GetData());
 						char strhash[MAX_PATH] = { 0 };
 						get_file_sm3digest(strhash, MAX_PATH, sourFileName.GetData());
 						DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("%s file size is %u byte,sm3 digest is %s.", sourFileName.GetData(), ufilesize, strhash);
@@ -1649,22 +1579,17 @@ int CSalesRecorderEntity::HandleEncryptVideoRecord(const char* videofilename)
 	if (0 != iresult) {
 		LogWarn(Severity_Middle, Error_Debug, LOG_EVT_SALESRECORD_ENCRYPT_FAILED, CSimpleStringA::Format("encryption file %s failed, delete out temp file %s!", videofilename, strOutFile).GetData());
 		if (ExistsFile(strOutFile)) {
-			if (!RvcDeleteFile(strOutFile)) {
+			if (!RemoveFileA(strOutFile)) {
 				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("DeleteFile file %s failed!", strOutFile);
 			}
 		}
 		return iRet;
 	}
 
-	bool bRet = RvcDeleteFile(videofilename);
+	bool bRet = RemoveFileA(videofilename);
 	if (!bRet) {
-		//TODO: CrossPlaform  [Gifur@2025730]
-#ifdef RVC_OS_WIN
 		LogWarn(Severity_Middle, Error_Debug, LOG_EVT_SALESRECORD_DELETE_FAILED, CSimpleStringA::Format("Error Code %lu while delete %s, delete out temp file[%s]!", GetLastError(), videofilename, strOutFile).GetData());
-#else
-		LogWarn(Severity_Middle, Error_Debug, LOG_EVT_SALESRECORD_DELETE_FAILED, CSimpleStringA::Format("%s(%d) while delete %s, delete out temp file[%s]!", strerror(errno), errno, videofilename, strOutFile).GetData());
-#endif // RVC_OS_WIN
-		if (!RvcDeleteFile(strOutFile)) {
+		if (!RemoveFileA(strOutFile)) {
 			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("DeleteFile file %s failed!", strOutFile);
 		}
 		return iRet;
@@ -1675,12 +1600,7 @@ int CSalesRecorderEntity::HandleEncryptVideoRecord(const char* videofilename)
 			iRet = 0;
 		}
 		else {
-			//TODO: CrossPlaform  [Gifur@2025730]
-#ifdef RVC_OS_WIN
 			LogWarn(Severity_Middle, Error_Debug, LOG_EVT_SALESRECORD_RENAME_FAILED, CSimpleStringA::Format("Error Code %lu while rename %s.", GetLastError(), strOutFile).GetData());
-#else
-			LogWarn(Severity_Middle, Error_Debug, LOG_EVT_SALESRECORD_RENAME_FAILED, CSimpleStringA::Format("%s(%d) while rename %s.", strerror(errno), errno, strOutFile).GetData());
-#endif // RVC_OS_WIN	
 		}
 	}
 

+ 0 - 8
Module/mod_SalesRecorder/mod_SalesRecorder.h

@@ -34,18 +34,10 @@ namespace SalesRecorder {
 		char Reserved2[128];
 	} RecordSubTitle;
 
-	//TODO: CrossPlaform  [Gifur@2025730]
-#ifdef RVC_OS_WIN
-	class CSalesRecorderEntity : public CEntityBase, public CHostApi, public ILogListener,public ISysVarListener, public ITimerListener
-	{
-	public:
-		CSalesRecorderEntity() : m_pRecorder(NULL), m_bStarted(false) { ZeroMemory(m_SalesVideoName, MAX_PATH); }
-#else
 	class CSalesRecorderEntity : public CEntityBase, public CHostApi, public ILogListener, public ISysVarListener, public ITimerListener
 	{
 	public:
 		CSalesRecorderEntity() : m_pRecorder(NULL), m_bStarted(false) { ZeroMemory(m_SalesVideoName, MAX_PATH); }
-#endif // RVC_OS_WIN
 
 		virtual ~CSalesRecorderEntity() { /*empty implementation*/ }
 

+ 32 - 208
Module/mod_UpgradeMgr/UpgradeTaskFSM.cpp

@@ -1420,7 +1420,7 @@ namespace Task
 							delete[] content;
 							return 4;//下载失败,算hash失败
 						}
-						//不区分大小写比较文件hash
+						//不区分大小写比较文件hash /** 为什么有平台差异??  [Gifur@2025821]*/
 #ifdef RVC_OS_WIN
 						if(stricmp(strMD5Val.GetData(),resp.sm3.c_str())==0){
 #else
@@ -1431,12 +1431,7 @@ namespace Task
 								if(remove(dPackPath)==0){
 									DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("delete download old pack succ ", dPackPath);
 									if(rename(dPackPathTemp.GetData(),dPackPath)!=0){
-										//TODO: CrossPlaform  [Gifur@2025730]
-#ifdef RVC_OS_WIN
-										errMsg = CSimpleStringA::Format("exist old file,remove temp file fail, error=%d",(int)GetLastError()).GetData();
-#else
-										errMsg = CSimpleStringA::Format("exist old file,remove temp file fail, error=%d", errno).GetData();
-#endif										
+										errMsg = CSimpleStringA::Format("exist old file,remove temp file fail, error=%d", (int)GetLastError()).GetData();
 										LogWarn(Severity_Middle, Error_Exception, ERR_TASK_DOWNLOAD_PACK_FAIL,errMsg.GetData());
 										delete[] content;
 										return 4;//下载失败,移动文件失败
@@ -1445,24 +1440,14 @@ namespace Task
 										return 1;//成功返回
 									}
 								}else{
-									//TODO: CrossPlaform  [Gifur@2025730]
-#ifdef RVC_OS_WIN
-									errMsg = CSimpleStringA::Format("delete download old pack fail ,error:%d",(int)GetLastError()).GetData();
-#else
-									errMsg = CSimpleStringA::Format("delete download old pack fail ,error:%d", errno).GetData();
-#endif
+									errMsg = CSimpleStringA::Format("delete download old pack fail ,error:%d", (int)GetLastError()).GetData();
 									LogWarn(Severity_Middle, Error_Exception, ERR_TASK_DOWNLOAD_PACK_FAIL,errMsg.GetData());
 									delete[] content;
 									return 4;//下载失败,删除旧文件失败
 								}
 							}else{
 								if(rename(dPackPathTemp.GetData(),dPackPath)!=0){
-									//TODO: CrossPlaform  [Gifur@2025730]
-#ifdef RVC_OS_WIN
-									errMsg = CSimpleStringA::Format("not exist old file,remove temp file fail, error=%d",(int)GetLastError()).GetData();
-#else
-									errMsg = CSimpleStringA::Format("not exist old file,remove temp file fail, error=%d", errno).GetData();
-#endif
+									errMsg = CSimpleStringA::Format("not exist old file,remove temp file fail, error=%d", (int)GetLastError()).GetData();
 									LogWarn(Severity_Middle, Error_Exception, ERR_TASK_DOWNLOAD_PACK_FAIL,errMsg.GetData());
 									delete[] content;
 									return 4;//移动文件失败
@@ -1478,12 +1463,7 @@ namespace Task
 							if(remove(dPackPathTemp.GetData())==0){
 								DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("delete download temp pack succ ,%s", dPackPathTemp.GetData());
 							}else{
-								//TODO: CrossPlaform  [Gifur@2025730]
-#ifdef RVC_OS_WIN							
-								DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("delete download temp pack fail ,%s  error:%d", dPackPathTemp.GetData(), GetLastError());
-#else
-								DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("delete download temp pack fail ,%s  error:%d", dPackPathTemp.GetData(), errno);
-#endif								
+								DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("delete download temp pack fail ,%s  error:%d", dPackPathTemp.GetData(), GetLastError());
 							}
 							delete[] content;
 							return 4;//下载失败,hash不对
@@ -1798,28 +1778,16 @@ ErrorCodeEnum CUpgradeTaskFSM::CreateNewVersion(CVersion NewSoftwareVersion,CSim
 	{
 		DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("new version dir [%s] already exist, delete it", strNewVerPath.GetData());
 		if(!RemoveDirRecursiveA(strNewVerPath.GetData())){
-			//TODO: CrossPlaform  [Gifur@2025730]
-#ifdef RVC_OS_WIN
-			DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("Create new version fail, delete already exist new version is fail:%d",GetLastError());
-			strErrInfo = CSimpleStringA::Format("Create new version fail, delete already exist new version is fail:%d",(int)GetLastError());
-#else
-			DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("Create new version fail, delete already exist new version is fail:%d", errno);
-			strErrInfo = CSimpleStringA::Format("Create new version fail, delete already exist new version is fail:%d", errno);
-#endif		
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("Create new version fail, delete already exist new version is fail:%d", GetLastError());
+			strErrInfo = CSimpleStringA::Format("Create new version fail, delete already exist new version is fail:%d", (int)GetLastError());
 			return Error_Bug;
 		}
 	}
 
 	if (!CreateDirA(strNewVerPath.GetData(), TRUE))
 	{
-		//TODO: CrossPlaform  [Gifur@2025730]
-#ifdef RVC_OS_WIN
-		DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("Create new version dir fail: %d", GetLastError());
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("Create new version dir fail: %d", GetLastError());
 		strErrInfo = CSimpleStringA::Format("create new version dir fail: %d", (int)GetLastError());
-#else
-		DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("Create new version dir fail: %d", errno);
-		strErrInfo = CSimpleStringA::Format("create new version dir fail: %d", errno);
-#endif	
 		return Error_Unexpect;
 	}
 	DbgWithLink(LOG_LEVEL_DEBUG,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("create new version dir succ, dir = %s",strNewVerPath.GetData());
@@ -1938,12 +1906,7 @@ ErrorCodeEnum CUpgradeTaskFSM::ClearUpgradeFailVersion(CVersion NewSoftwareVersi
 	if (ExistsDirA(strNewVerPath.GetData()))
 	{
 		if(!RemoveDirRecursiveA(strNewVerPath.GetData())){
-			//TODO: CrossPlaform  [Gifur@2025730]
-#ifdef RVC_OS_WIN
-			DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("ClearUpgradeFailVersion fail, delete temp Version [%s] is fail:%d",strNewVerPath.GetData(),(int)GetLastError());
-#else
-			DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("ClearUpgradeFailVersion fail, delete temp Version [%s] is fail:%d", strNewVerPath.GetData(), errno);
-#endif
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("ClearUpgradeFailVersion fail, delete temp Version [%s] is fail:%d", strNewVerPath.GetData(), (int)GetLastError());
 			return Error_Bug;
 		}else{
 			DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("ClearUpgradeFailVersion succ, delete temp Version [%s] ", strNewVerPath.GetData());
@@ -1996,18 +1959,10 @@ bool CUpgradeTaskFSM::GetSysUpgradeResult(const char *pszResultLog, CSimpleStrin
 		auto arr2 = arr[i].Split('=');
 		if (arr2.GetCount() == 2)
 		{
-			//TODO: CrossPlaform  [Gifur@2025730]
-#ifdef RVC_OS_WIN
 			if (stricmp(arr2[0], "result") == 0)
 				eErrorCode = arr2[1];
 			else if (stricmp(arr2[0], "msg") == 0)
 				strErrMsg = arr2[1];
-#else
-			if (strcmp(arr2[0], "result") == 0)
-				eErrorCode = arr2[1];
-			else if (strcmp(arr2[0], "msg") == 0)
-				strErrMsg = arr2[1];
-#endif
 		}
 	}
 	return true;
@@ -2193,15 +2148,9 @@ int CUpgradeTaskFSM::ExecRunCmd(CSimpleStringA &strErrMsg,CInstallStep* ins)
 		int ret = system_on(sysPathStr,true,err);
 		osutil_reset_redirect_32sys_in_wow64(&store);
 		if(ret!=0){
-			//TODO: CrossPlaform  [Gifur@2025730]
 			//程序执行异常,结果未知
-#ifdef RVC_OS_WIN
-			DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("ExecRunCmd is fail, system_on exec unknown ,err=%s",err.GetData());
-			strErrMsg = CSimpleStringA::Format("ExecRunCmd is fail, system_on exec unknown ,err=%s",err.GetData());
-#else
-			DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("ExecRunCmd is fail, system_on exec unknown , ret=%d, err=%s",ret, strerror(errno));
-			strErrMsg = CSimpleStringA::Format("ExecRunCmd is fail, system_on exec unknown  ret=%d, err=%s", ret, strerror(errno));
-#endif			
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("ExecRunCmd is fail, system_on exec unknown ,err=%s", err.GetData());
+			strErrMsg = CSimpleStringA::Format("ExecRunCmd is fail, system_on exec unknown ,err=%s", err.GetData());
 			return -1;//未知结果返回
 
 		}else{
@@ -2222,14 +2171,8 @@ int CUpgradeTaskFSM::ExecRunCmd(CSimpleStringA &strErrMsg,CInstallStep* ins)
 				DbgWithLink(LOG_LEVEL_DEBUG,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("ExecRunCmd is succ,[%s] ", destPath.GetData());
 				return 1;//成功
 			}else{
-				//TODO: CrossPlaform  [Gifur@2025730]
-#ifdef RVC_OS_WIN
-				DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("ExecRunCmd is fail,errorCode = %s", eErrorCode.GetData());
+				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("ExecRunCmd is fail,errorCode = %s", eErrorCode.GetData());
 				strErrMsg = CSimpleStringA::Format("ExecRunCmd is fail,errorCode = %s", eErrorCode.GetData());
-#else
-				DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("ExecRunCmd is fail,errorCode = %s,%s", eErrorCode.GetData(), strErrMsg.GetData());
-				strErrMsg = CSimpleStringA::Format("ExecRunCmd is fail,errorCode = %s,%s", eErrorCode.GetData(), strErrMsg.GetData());
-#endif			
 				return 0;//失败
 			}
 		}
@@ -2652,17 +2595,12 @@ ErrorCodeEnum CUpgradeTaskFSM::CopyFileOperate(const char* srcPath, const char*
 	case 1:
 		{
 		if (bDestFileExists) {
-			//TODO: CrossPlaform  [Gifur@2025730]
-#ifdef RVC_OS_WIN
-			bRet = CopyFileA(srcPath, destPath, FALSE);
-#else
 			if (fileutil_copy_file(destPath, srcPath) == 0) {
 				bRet = TRUE;
 			}
 			else {
 				bRet = FALSE;
 			}
-#endif
 		}
 		else {
 			LOG_TRACE("ignore file [%s] copy for dest file not exists", srcPath);
@@ -2671,34 +2609,25 @@ ErrorCodeEnum CUpgradeTaskFSM::CopyFileOperate(const char* srcPath, const char*
 		break;
 	case 2:
 		{
-			if (!bDestFileExists)
-				//TODO: CrossPlaform  [Gifur@2025730]
-#ifdef RVC_OS_WIN
-				bRet = CopyFileA(srcPath, destPath, TRUE);
-#else
-				if (fileutil_copy_file(destPath, srcPath) == 0) {
-					bRet = TRUE;
-				}
-				else {
-					bRet = FALSE;
-				}
-#endif
+		if (!bDestFileExists) {
+			if (fileutil_copy_file(destPath, srcPath) == 0) {
+				bRet = TRUE;
+			}
+			else {
+				bRet = FALSE;
+			}
+		}
 			else
 				LOG_TRACE("ignore file [%s] copy for dest file exists", srcPath);
 		}
 		break;
 	case 3:
-		//TODO: CrossPlaform  [Gifur@2025730]
-#ifdef RVC_OS_WIN
-		bRet = CopyFileA(srcPath, destPath, FALSE);
-#else
 		if (fileutil_copy_file(destPath, srcPath) == 0) {
 			bRet = TRUE;
 		}
 		else {
 			bRet = FALSE;
 		}
-#endif
 		break;
 	case 4:
 		{
@@ -2714,12 +2643,7 @@ ErrorCodeEnum CUpgradeTaskFSM::CopyFileOperate(const char* srcPath, const char*
 	if (bRet){
 		RemoveFileReadOnlyAttributeA(destPath);
 	}else{
-		//TODO: CrossPlaform  [Gifur@2025730]
-#ifdef RVC_OS_WIN
 		strErrMsg = CSimpleStringA::Format("CopyFileOperate copy file fail:%d", GetLastError());
-#else
-		strErrMsg = CSimpleStringA::Format("CopyFileOperate copy file fail:%d", errno);
-#endif
 	}
 	ErrorCodeEnum rc = bRet ? Error_Succeed : Error_Unexpect;
 	return rc;
@@ -2739,12 +2663,7 @@ ErrorCodeEnum CUpgradeTaskFSM::SetRunSucceed(const char* pPackFile)
 	}
 	CSimpleStringA strSourcePath = CSimpleStringA::Format("%s" SPLIT_SLASH_STR "%s", (const char*)strDownloadPath, pPackFile);
 	CSimpleStringA strDestPath = CSimpleStringA::Format("%s" SPLIT_SLASH_STR "%s", (const char*)strUpgradedPath, pPackFile);
-	//TODO: CrossPlaform  [Gifur@2025730]
-#ifdef RVC_OS_WIN
-	CopyFileA(strSourcePath.GetData(), strDestPath.GetData(), FALSE);
-#else
 	fileutil_copy_file(strDestPath.GetData(), strSourcePath.GetData());
-#endif
 	return Error_Succeed;
 }
 
@@ -3144,12 +3063,11 @@ bool CUpgradeTaskFSM::IsFileMatch(const char *pszFilter, const char *pszFileName
 }
 
 bool CUpgradeTaskFSM::RecursiveCopyDir(const char *pszSourceDir, const char *pszDestDir,CSimpleStringA &strErrInfo)
-{//TODO: CrossPlaform  [Gifur@2025730]
+{
 	array_header_t *arr;
-#ifdef RVC_OS_WIN
 	if (!ExistsDirA(pszSourceDir))
 	{
-		DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM)("source dir [%s] not exists: %d", pszSourceDir,GetLastError());
+		DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("source dir [%s] not exists: %d", pszSourceDir, GetLastError());
 		strErrInfo = CSimpleStringA::Format("source dir [%s] not exists: %d", pszSourceDir, GetLastError());
 		return false;
 	}
@@ -3159,32 +3077,11 @@ bool CUpgradeTaskFSM::RecursiveCopyDir(const char *pszSourceDir, const char *psz
 		if (!CreateDirRecursiveA(pszDestDir))
 		{
 			strErrInfo = CSimpleStringA::Format("create dir [%s] fail: %d", pszDestDir, GetLastError());
-			DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM)("create dir fail: %s",strErrInfo.GetData());
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("create dir fail: %s", strErrInfo.GetData());
 			return false;
 		}
-
-		//DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM)("create dir [%s] succ", pszDestDir);
-	}
-#else
-	if (!ExistsDirA(pszSourceDir))
-	{
-		DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM)("source dir [%s] not exists: %d", pszSourceDir, errno);
-		strErrInfo = CSimpleStringA::Format("source dir [%s] not exists: %d", pszSourceDir, errno);
-		return false;
 	}
 
-	if (!ExistsDirA(pszDestDir))
-	{
-		if (!CreateDirRecursiveA(pszDestDir))
-		{
-			strErrInfo = CSimpleStringA::Format("create dir [%s] fail: %d", pszDestDir, errno);
-			DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM)("create dir fail: %s",strErrInfo.GetData());
-			return false;
-		}
-
-		//DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM)("create dir [%s] succ", pszDestDir);
-	}
-#endif
 	arr = fileutil_get_sub_files_a(pszSourceDir);
 	if (arr)
 	{
@@ -3197,24 +3094,13 @@ bool CUpgradeTaskFSM::RecursiveCopyDir(const char *pszSourceDir, const char *psz
 			if (szDestFile[strlen(szDestFile) - 1] != SPLIT_SLASH)
 				strcat(szDestFile, SPLIT_SLASH_STR);
 			strcat(szDestFile, strrchr(file, SPLIT_SLASH) + 1);
-			//TODO: CrossPlaform  [Gifur@2025730]
-#ifdef RVC_OS_WIN
-			if (!CopyFileA(file, szDestFile, FALSE))
-			{
-				strErrInfo = CSimpleStringA::Format("copy file [%s] fail: %d", file, GetLastError());
-				DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM)("copy file fail:%s",strErrInfo.GetData());
-				toolkit_array_free2(arr);
-				return false;
-			}
-#else
-			if (fileutil_copy_file(szDestFile, file)!=0)
+			if (fileutil_copy_file(szDestFile, file) != 0)
 			{
 				strErrInfo = CSimpleStringA::Format("copy file [%s] fail: %d", file, errno);
-				DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM)("copy file fail:%s",strErrInfo.GetData());
+				DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM)("copy file fail:%s", strErrInfo.GetData());
 				toolkit_array_free2(arr);
 				return false;
 			}
-#endif						
 		}
 		toolkit_array_free2(arr);
 	}
@@ -3234,25 +3120,13 @@ bool CUpgradeTaskFSM::RecursiveCopyDir(const char *pszSourceDir, const char *psz
 
 			if (!RecursiveCopyDir(dir, szDestSubDir,strErrInfo))
 			{
-				//TODO: CrossPlaform  [Gifur@2025730]
-#ifdef RVC_OS_WIN
-				DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM)("copy dir [%s] fail: %d", dir, GetLastError());
-				if(strErrInfo.IsNullOrEmpty()){
-					strErrInfo = CSimpleStringA::Format("copy dir [%s] fail: %d", dir, GetLastError());
-				}
-				toolkit_array_free2(arr);
-				return false;
-#else
-				DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM)("copy dir [%s] fail: %d", dir, errno);
+				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("copy dir [%s] fail: %d", dir, GetLastError());
 				if (strErrInfo.IsNullOrEmpty()) {
-					strErrInfo = CSimpleStringA::Format("copy dir [%s] fail: %d", dir, errno);
+					strErrInfo = CSimpleStringA::Format("copy dir [%s] fail: %d", dir, GetLastError());
 				}
 				toolkit_array_free2(arr);
 				return false;
-#endif				
 			}
-
-			//DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM)("copy dir [%s] succ", dir);
 		}
 		toolkit_array_free2(arr);
 	}
@@ -3528,12 +3402,7 @@ ErrorCodeEnum CUpgradeTaskFSM::DeleteUnzipDir()
 	if (ExistsDirA(strUnzipDir.GetData()))
 	{
 		if(!RemoveDirRecursiveA(strUnzipDir.GetData())){
-			//TODO: CrossPlaform  [Gifur@2025730]
-#ifdef RVC_OS_WIN		
-			DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM)("DeleteUnzipDir fail , temp unzip dir [%s] fail,err=%d",strUnzipDir.GetData(),(int)GetLastError());
-#else
-			DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM)("DeleteUnzipDir fail , temp unzip dir [%s] fail,err=%d",strUnzipDir.GetData(), errno);
-#endif
+			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("DeleteUnzipDir fail , temp unzip dir [%s] fail,err=%d", strUnzipDir.GetData(), (int)GetLastError());
 			return Error_Unexpect;
 		}else{
 			return Error_Succeed;
@@ -4023,7 +3892,7 @@ ErrorCodeEnum CUpgradeTaskFSM::loadCenterCfgInfo()
 	}
 	return Error_Succeed;
 }
-//TODO: CrossPlaform  [Gifur@2025730]
+//TODO: CrossPlaform  如果是获取文件大小,建议直接采用 fileutil中的 ReadFileSize [Gifur@2025730]
 bool CUpgradeTaskFSM::GetFileLength(const char* filePath,long &fileLen)
 {
 	FILE* file = fopen(filePath, "rb");  
@@ -4701,28 +4570,16 @@ ErrorCodeEnum CUpgradeTaskFSM::CreateNewDepVersion(CSimpleStringA NewSoftwareVer
 	{
 		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("new version dir [%s] already exist, delete it", strNewVerPath.GetData());
 		if (!RemoveDirRecursiveA(strNewVerPath.GetData())) {
-			//TODO: CrossPlaform  [Gifur@2025730]
-#ifdef RVC_OS_WIN
 			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("Create new dep version fail, delete already exist new dep version is fail:%d", GetLastError());
 			strErrInfo = CSimpleStringA::Format("Create new dep version fail, delete already exist new dep version is fail:%d", (int)GetLastError());
-#else
-			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("Create new dep version fail, delete already exist new dep version is fail:%d", errno);
-			strErrInfo = CSimpleStringA::Format("Create new dep version fail, delete already exist new dep version is fail:%d", errno);
-#endif		
 			return Error_Bug;
 		}
 	}
 
 	if (!CreateDirA(strNewVerPath.GetData(), TRUE))
 	{
-		//TODO: CrossPlaform  [Gifur@2025730]
-#ifdef RVC_OS_WIN
 		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("Create new dep version dir fail: %d", GetLastError());
 		strErrInfo = CSimpleStringA::Format("create new dep version dir fail: %d", (int)GetLastError());
-#else
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("Create new dep version dir fail: %d", errno);
-		strErrInfo = CSimpleStringA::Format("create new dep version dir fail: %d", errno);
-#endif	
 		return Error_Unexpect;
 	}
 	DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("create new dep version dir succ, dir = %s", strNewVerPath.GetData());
@@ -4800,12 +4657,7 @@ ErrorCodeEnum CUpgradeTaskFSM::ClearUpgradeFailDepVersion(CSimpleStringA NewSoft
 	if (ExistsDirA(strNewVerPath.GetData()))
 	{
 		if (!RemoveDirRecursiveA(strNewVerPath.GetData())) {
-			//TODO: CrossPlaform  [Gifur@2025730]
-#ifdef RVC_OS_WIN
 			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("ClearUpgradeFailDepVersion fail, delete temp Version [%s] is fail:%d", strNewVerPath.GetData(), (int)GetLastError());
-#else
-			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("ClearUpgradeFailDepVersion fail, delete temp Version [%s] is fail:%d", strNewVerPath.GetData(), errno);
-#endif
 			return Error_Bug;
 		}
 		else {
@@ -5044,14 +4896,8 @@ int CUpgradeTaskFSM::ExecDepRunCmd(CSimpleStringA& strErrMsg, CInstallStep* ins)
 		osutil_reset_redirect_32sys_in_wow64(&store);
 		if (ret != 0) {
 			//程序执行异常,结果未知
-			//TODO: CrossPlaform  [Gifur@2025730]
-#ifdef RVC_OS_WIN
 			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("ExecRunCmd is fail, system_on exec unknown ,err=%s", err.GetData());
 			strErrMsg = CSimpleStringA::Format("ExecRunCmd is fail, system_on exec unknown ,err=%s", err.GetData());
-#else
-			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("ExecRunCmd is fail, system_on exec unknown , ret=%d, err=%s", ret, strerror(errno));
-			strErrMsg = CSimpleStringA::Format("ExecRunCmd is fail, system_on exec unknown  ret=%d, err=%s", ret, strerror(errno));
-#endif			
 			return -1;//未知结果返回
 		}
 		else {
@@ -5073,14 +4919,8 @@ int CUpgradeTaskFSM::ExecDepRunCmd(CSimpleStringA& strErrMsg, CInstallStep* ins)
 				return 1;//成功
 			}
 			else {
-				//TODO: CrossPlaform  [Gifur@2025730]
-#ifdef RVC_OS_WIN
 				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("ExecRunCmd is fail,errorCode = %s", eErrorCode.GetData());
 				strErrMsg = CSimpleStringA::Format("ExecRunCmd is fail,errorCode = %s", eErrorCode.GetData());
-#else
-				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("ExecRunCmd is fail,errorCode = %s,%s", eErrorCode.GetData(), strErrMsg.GetData());
-				strErrMsg = CSimpleStringA::Format("ExecRunCmd is fail,errorCode = %s,%s", eErrorCode.GetData(), strErrMsg.GetData());
-#endif			
 				return 0;//失败
 			}
 		}
@@ -5689,14 +5529,8 @@ bool CUpgradeTaskFSM::DownloadFileWrite(byte* content,long contentLen,const char
 	fclose(tempFp);
 
 	if(ret!=1){
-		//TODO: CrossPlaform  [Gifur@2025730]
-#ifdef RVC_OS_WIN
-		DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("DownloadFileWrite write file fail,ret = %d,errno = %d",ret,(int)GetLastError());
-		return false;
-#else
-		DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("DownloadFileWrite write file fail,ret = %d,errno = %d",ret, errno);
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("DownloadFileWrite write file fail,ret = %d,errno = %d", ret, (int)GetLastError());
 		return false;
-#endif		
 	}
 	return true;
 }
@@ -5969,21 +5803,11 @@ bool CUpgradeTaskFSM::isWork()
 	if((!m_currentTask.NewVersion.IsNullOrEmpty())&&(m_currentTask.cPendingState=="T"||m_currentTask.cPendingState=="C"||m_currentTask.cPendingState=="X")){
 		CSimpleStringA strRunInfo,strStartTime;
 		if (m_pEntity->GetFunction()->GetPath("RunInfo",strRunInfo) == Error_Succeed){
-			//TODO: CrossPlaform  [Gifur@2025730]
-#ifdef RVC_OS_WIN
-			strStartTime = strRunInfo + "\\runcfg\\starttime.dat";
-#else
-			strStartTime = strRunInfo + "/runcfg/starttime.dat";
-#endif
+			strStartTime = strRunInfo + SPLIT_SLASH_STR "runcfg" SPLIT_SLASH_STR "starttime.dat";
 			if(!ExistsFileA(strStartTime.GetData())){
 				return true;//完成升级过程,通过
 			}else{
-				//TODO: CrossPlaform  [Gifur@2025730]
-#ifdef RVC_OS_WIN
-				DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM)("upgrade process is not end ,file \\runcfg\\starttime is exist");
-#else
-				DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM)("upgrade process is not end ,file /runcfg/starttime is exist");
-#endif
+				DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("upgrade process is not end ,file %s is exist", strStartTime.GetData());
 				return false;//继续等待
 			}
 		}else{

+ 1 - 6
Module/mod_UpgradeMgr/mod_UpgradeMgr.cpp

@@ -432,12 +432,7 @@ ErrorCodeEnum CUpgradeMgrEntity::testActive()
 	//TODO: CrossPlaform  [Gifur@2025729]
 	FILE* fp = fopen(strActiveFile.GetData(),"rb+");
 	if(fp==NULL){
-		//TODO: CrossPlaform  [Gifur@2025730]
-#ifdef RVC_OS_WIN
-		LogWarn(Severity_Middle, Error_Exception, ERR_WRAN_OPEN_ACTIVE_FAIL,CSimpleStringA::Format("open write active.txt fail,please edit active attribute, err=%d",(int)GetLastError()).GetData());
-#else
-		LogWarn(Severity_Middle, Error_Exception, ERR_WRAN_OPEN_ACTIVE_FAIL,CSimpleStringA::Format("open write active.txt fail,please edit active attribute, err=%d",errno).GetData());
-#endif	
+		LogWarn(Severity_Middle, Error_Exception, ERR_WRAN_OPEN_ACTIVE_FAIL, CSimpleStringA::Format("open write active.txt fail,please edit active attribute, err=%d", (int)GetLastError()).GetData());
 		return Error_Unexpect;
 	}
 	fclose(fp);

+ 10 - 10
Module/mod_recorder/mod_recorder.cpp

@@ -445,7 +445,7 @@ ErrorCodeEnum CRecorderEntity::AddToVideoRecordList(const char* videofilename)
 
 	item->file_path = videofilename;
 
-	item->file_length = (int)GetFileSize(videofilename);
+	item->file_length = (int)ReadFileSize(videofilename);
 
 	const char* strfilename = GetFileName(videofilename);
 	if (strfilename) {
@@ -521,7 +521,7 @@ void CRecorderEntity::OnLog(const CAutoArray<CUUID> &SubIDs, const CUUID nLogID,
 
 	case LOG_EVT_RECORDER_SECTION_FINISHED:
 		{
-			unsigned long uSize = GetFileSize(pszMessage);
+			unsigned long uSize = ReadFileSize(pszMessage);
 			if (RVC_MIN_RECORD_FILESIZE < uSize) {
 				if (m_bEncFlag) {
 					HandleEncryptVideoRecord(pszMessage);
@@ -530,14 +530,14 @@ void CRecorderEntity::OnLog(const CAutoArray<CUUID> &SubIDs, const CUUID nLogID,
 			}
 			else {
 				LogWarn(Severity_Low, Error_Debug, LOG_EVT_INVALID_RECORD_FILE, CSimpleStringA::Format("invalid record file %s, delelte it.", pszMessage).GetData());
-				RvcDeleteFile(pszMessage);
+				RemoveFileA(pszMessage);
 			}
 		}
 		break;
 
 	case LOG_EVT_RECORDER_WHOLE_FINISHED:
 		{
-			unsigned long uSize = GetFileSize(pszMessage);
+			unsigned long uSize = ReadFileSize(pszMessage);
 			if (RVC_MIN_RECORD_FILESIZE < uSize) {
 				if (m_bEncFlag) {
 					HandleEncryptVideoRecord(pszMessage);
@@ -547,7 +547,7 @@ void CRecorderEntity::OnLog(const CAutoArray<CUUID> &SubIDs, const CUUID nLogID,
 			}
 			else {
 				LogWarn(Severity_Low, Error_Debug, LOG_EVT_INVALID_RECORD_FILE, CSimpleStringA::Format("invalid record file %s, delelte it.", pszMessage).GetData());
-				RvcDeleteFile(pszMessage);
+				RemoveFileA(pszMessage);
 			}
 		}
 		break;
@@ -955,10 +955,10 @@ int CRecorderEntity::SaveExceptionRecordVideos()
 			if (0 == memcmp(FindFileData.cFileName, RVC_TRANSATCION_RECORD_SUFFIX, strlen(RVC_TRANSATCION_RECORD_SUFFIX)) ||
 				0 == memcmp(FindFileData.cFileName, RVC_ENCRYPT_TRANSATCION_RECORD_SUFFIX, strlen(RVC_ENCRYPT_TRANSATCION_RECORD_SUFFIX))){
 				CSimpleStringA srcfile = CSimpleStringA::Format("%s%s",m_TempDir.GetData(), FindFileData.cFileName);
-				unsigned long uSize = GetFileSize(srcfile.GetData());
+				unsigned long uSize = ReadFileSize(srcfile.GetData());
 				if (RVC_MIN_RECORD_FILESIZE >= uSize) {
 					LogWarn(Severity_Low, Error_Debug, LOG_EVT_INVALID_RECORD_FILE, CSimpleStringA::Format("invalid record file %s, delelte it.", srcfile.GetData()).GetData());
-					RvcDeleteFile(srcfile.GetData());
+					RemoveFileA(srcfile.GetData());
 					goto on_next;
 				}
 
@@ -967,7 +967,7 @@ int CRecorderEntity::SaveExceptionRecordVideos()
 					cb.dbg = &rvcDbg;
 					if (false == is_file_encrypted(srcfile.GetData(), &cb)){
 						if (strstr(FindFileData.cFileName, RVC_FILEENC_STR)) {
-							RvcDeleteFile(srcfile.GetData());
+							RemoveFileA(srcfile.GetData());
 							goto on_next;
 						}
 
@@ -988,7 +988,7 @@ int CRecorderEntity::SaveExceptionRecordVideos()
 							}
 							else{
 								LogWarn(Severity_Low, Error_Debug, LOG_EVT_RECORDER_RENAME_FAILED, CSimpleStringA::Format("Error Code %lu while rename %s, delete it.", GetLastError(), srcfile.GetData()).GetData());
-								RvcDeleteFile(srcfile.GetData());
+								RemoveFileA(srcfile.GetData());
 								goto on_next;
 							}
 						}
@@ -997,7 +997,7 @@ int CRecorderEntity::SaveExceptionRecordVideos()
 
 				if (strstr(srcfile.GetData(), RVC_FILEENC_STR)) {
 					LogWarn(Severity_Low, Error_Debug, LOG_EVT_ABNORMAL_RECORD_FILE, CSimpleStringA::Format("abnormal file %s, delete it.",  srcfile.GetData()).GetData());
-					RvcDeleteFile(srcfile.GetData());
+					RemoveFileA(srcfile.GetData());
 					goto on_next;
 				}
 

+ 4 - 28
Module/mod_screenshot/mod_screenshot.cpp

@@ -158,8 +158,6 @@ public:
 		if (preOperationError != Error_Succeed)
 			return preOperationError;
 
-		/** 礼鹏看到对此做下移除,没有壁挂式这个机型了  [Gifur@2025724]*/
-		m_bIsWallMachine = false;
 		return Error_Succeed;
 	}
 
@@ -204,11 +202,6 @@ public:
 		int cx, cy;
 		getScreenSize(&cx, &cy);
 #endif
-		//TODO: CrossPlaform  [Gifur@2025730]
-		if (m_bIsWallMachine)
-		{
-			cy = cy-640;
-		} 
 		screen_encoder_session_create(cx, cy, &m_enc_session);
 		return Error_Succeed;
 	}
@@ -245,7 +238,7 @@ public:
 			DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("capture screen failed! %d", err);
 			return;
 		}
-		if((SysInfo.eScreen == 1)&&!m_bIsWallMachine)
+		if(SysInfo.eScreen == 1)
 		{
 			CSimpleStringA strValue;
 			ErrorCodeEnum Error = GetFunction()->GetSysVar("VideoWindowInitializeParam", strValue);
@@ -284,25 +277,9 @@ public:
 		Info.type = ACM_TYPE_SRN;
 		Info.id = id;
 		Info.sub_type = ACM_SRN_ANS | ACM_SRN_SNAPSHOT;
-		if (m_bIsWallMachine)
-		{
-			int width = rc.right - rc.left;
-			int height = rc.bottom - 640;
-			int linesize = (width * 3 + 3) & 0xfffffffc;
-			int newsize = linesize * height;
-			Info.data.Alloc(newsize);
-			void *buftmp = malloc(newsize);
-			memcpy(buftmp,buf,newsize);
-			screen_encoder_session_encode(m_enc_session, buftmp, Info.data.m_pData, &Info.data.m_iLength);
-			(*m_pChannelClient)(EntityResource::getLink().upgradeLink())->Send(Info);
-			free(buftmp);
-		}
-		else
-		{
-			Info.data.Alloc(size);
-			screen_encoder_session_encode(m_enc_session, buf, Info.data.m_pData, &Info.data.m_iLength);
-			(*m_pChannelClient)(EntityResource::getLink().upgradeLink())->Send(Info);
-		}	
+		Info.data.Alloc(size);
+		screen_encoder_session_encode(m_enc_session, buf, Info.data.m_pData, &Info.data.m_iLength);
+		(*m_pChannelClient)(EntityResource::getLink().upgradeLink())->Send(Info);
 
 #if 0
 		int linesize = size / cy;
@@ -504,7 +481,6 @@ private:
 	CAutoArray<CUUID> m_arrListener;
 
 	int m_id_seq;
-	bool m_bIsWallMachine;
 	bool m_bConnectAssist;
 };
 

+ 9 - 22
Module/mod_sipphone/mod_sipphone.cpp

@@ -14,6 +14,7 @@
 #include "../mod_counterconnector/Event.h"
 #include "../mod_evtconverter/Event.h"
 #include <winpr/string.h>
+#include <winpr/sysinfo.h>
 
 #define EVT_CONVERTER	"EventConverter"
 
@@ -42,7 +43,6 @@ static void __on_video_box_move(int imessagetype, int ivideotype, int ileft, int
 	pThis->on_video_box_move(imessagetype, ivideotype, ileft, ibottom);
 }
 
-
 static void __on_call_state(int state, const char *state_desc, const char *phrase, void *user_data)
 {
 	CSIPPhoneSession *pThis = static_cast<CSIPPhoneSession*>(user_data);
@@ -52,7 +52,6 @@ static void __on_call_state(int state, const char *state_desc, const char *phras
 	}
 }
 
-
 static int __make_call(void *user_data)
 {
 	MakeCallCommand_t *cmd = (MakeCallCommand_t*)user_data;
@@ -61,7 +60,6 @@ static int __make_call(void *user_data)
 	return rc;
 }
 
-
 static int __hangup_call(void *user_data)
 {
 	HangupCallCommand_t *cmd = (HangupCallCommand_t*)(user_data);
@@ -70,7 +68,6 @@ static int __hangup_call(void *user_data)
 	return 0;
 }
 
-
 static int __control_video(void *arg)
 {
 	ControlVideoCommand_t* pCmd = (ControlVideoCommand_t*)(arg);
@@ -79,8 +76,7 @@ static int __control_video(void *arg)
 	return 0;
 }
 
-#ifdef RVC_OS_WIN
-#else
+#ifndef RVC_OS_WIN
 static int __video_render(void* arg)
 {
 	VideoRenderCommand_t* pCmd = (VideoRenderCommand_t*)(arg);
@@ -101,16 +97,16 @@ static int __release_call(void *user_data)
 
 static void __audiomgrlog(void* user_data, const char* fmt, va_list arg)
 {
-	int n = rvc_vsnprintf(NULL, 0, fmt, arg);
+	int n = _vsnprintf(NULL, 0, fmt, arg);
 	if (n >= 512) {
 		char* buf = (char*)malloc((size_t)(n + 1));
-		rvc_vsnprintf(buf, n + 1, fmt, arg);
+		_vsnprintf(buf, n + 1, fmt, arg);
 		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("%s", buf);
 		free(buf);
 	}
 	else {
 		char strlog[512] = { 0 };
-		rvc_vsnprintf(strlog, 512, fmt, arg);
+		_vsnprintf(strlog, 512, fmt, arg);
 		DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("%s", strlog);
 	}
 }
@@ -118,23 +114,22 @@ static void __audiomgrlog(void* user_data, const char* fmt, va_list arg)
 
 static void __video_render_log(render_loglevel elevel, void* user_data, const char* fmt, va_list arg)
 {
-	int n = rvc_vsnprintf(NULL, 0, fmt, arg);
+	int n = _vsnprintf(NULL, 0, fmt, arg);
 	if (n >= MAX_PATH) {
 		char* buf = (char*)malloc((size_t)(n + 1));
-		rvc_vsnprintf(buf, n + 1, fmt, arg);
+		_vsnprintf(buf, n + 1, fmt, arg);
 		DbgWithLink((LOG_LEVEL_E)elevel, LOG_TYPE_SYSTEM)("%s", buf);
 		free(buf);
 	}
 	else {
 		char strlog[MAX_PATH] = { 0 };
-		rvc_vsnprintf(strlog, MAX_PATH, fmt, arg);
+		_vsnprintf(strlog, MAX_PATH, fmt, arg);
 		DbgWithLink((LOG_LEVEL_E)elevel, LOG_TYPE_SYSTEM)("%s", strlog);
 	}
 }
 
 
-#ifdef RVC_OS_WIN
-#else
+#ifndef RVC_OS_WIN
 static int __on_stop_remote_video_render_callback(void* user_data)
 {
 	int iret = -1;
@@ -752,17 +747,9 @@ ErrorCodeEnum CSIPEntity::ConnectAssistChannel()
 void CSIPEntity::HandleHandfreeAudioDeviceErrorEvent()
 {
 	char strNow[MAX_PATH] = { 0 };
-	//TODO: CrossPlaform  [Gifur@2025730]
-#ifdef RVC_OS_WIN
 	SYSTEMTIME st;
 	GetLocalTime(&st);
 	_snprintf(strNow, MAX_PATH, "%02d:%02d:%02d", st.wHour, st.wMinute, st.wSecond);
-#else
-	struct tm* ptm = NULL;
-	time_t t = time(NULL);
-	ptm = localtime(&t);
-	snprintf(strNow, MAX_PATH, "%02d:%02d:%02d", ptm->tm_hour, ptm->tm_min, ptm->tm_sec);
-#endif // RVC_OS_WIN
 
 	char strTime[MAX_PATH] = { 0 };
 	unsigned int utime = y2k_time_now();

+ 0 - 9
Module/mod_sipphone/mod_sipphone.h

@@ -56,15 +56,6 @@ using namespace AssistantChannel;
 #define RVC_ENTER_HOME_PAGE_TIMER 3
 #endif
 
-//TODO: CrossPlaform  [Gifur@2025730]
-#ifndef rvc_vsnprintf
-#ifdef _WIN32
-#define rvc_vsnprintf _vsnprintf
-#else
-#define rvc_vsnprintf vsnprintf
-#endif
-#endif
-
 typedef enum
 {
 	RVC_AUDIO_NO_ERROR = 0x0,				

+ 5 - 36
Module/mod_upload/UploadFSM.cpp

@@ -626,28 +626,18 @@ namespace Task
 				string destDir="";
 				//根据路径类型组成最后移动路径
 				if(m_fsm->m_currUploadFile->path_type=="R"){
-					//TODO: CrossPlaform 1111  [Gifur@2025730]
-#ifdef RVC_OS_WIN
-					destPath = m_fsm->m_rootPath+"\\"+m_fsm->m_currUploadFile->after_deal_text+"\\"+m_fsm->m_currUploadFile->fileName;
-					destDir = m_fsm->m_rootPath+"\\"+m_fsm->m_currUploadFile->after_deal_text;
-#else
 					destPath = m_fsm->m_rootPath + SPLIT_SLASH_STR + m_fsm->m_currUploadFile->after_deal_text + SPLIT_SLASH_STR + m_fsm->m_currUploadFile->fileName;
 					destDir = m_fsm->m_rootPath + SPLIT_SLASH_STR + m_fsm->m_currUploadFile->after_deal_text;
-#endif
 				}else{
-					//TODO: CrossPlaform  1111 [Gifur@2025730]
-#ifdef RVC_OS_WIN
-					destPath = m_fsm->m_currUploadFile->after_deal_text+"\\"+m_fsm->m_currUploadFile->fileName;
-#else
 					destPath = m_fsm->m_currUploadFile->after_deal_text + SPLIT_SLASH_STR + m_fsm->m_currUploadFile->fileName;
-#endif
 					destDir = m_fsm->m_currUploadFile->after_deal_text;
 				}
 				string srcPath = m_fsm->m_currUploadFile->filePath;
 				//DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("move file %s to %s",srcPath.c_str(),destPath.c_str());
 				//判断是否存在目标文件,如存在,则先删除
+				
 #ifdef RVC_OS_WIN
-				//TODO: CrossPlaform  [Gifur@2025730]
+				//TODO: CrossPlaform  需要梳理 [Gifur@2025730]
 				if(ExistsFileA(destPath.c_str())){
 					if(remove(destPath.c_str())==0){
 						DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("delete dest file is ok [%s]",destPath.c_str());
@@ -885,13 +875,7 @@ ErrorCodeEnum UploadFSM::OnInit()
 		if(Error_Succeed == Error){
 			if(!runPath.IsNullOrEmpty()){
 				string runPathStr = runPath.GetData();
-				//TODO: CrossPlaform  [Gifur@2025730]
-#ifdef RVC_OS_WIN
-				int pos = runPathStr.find_last_of('\\');
-#else
 				int pos = runPathStr.find_last_of(SPLIT_SLASH);//修改为路径分隔符
-#endif			
-				
 				m_rootPath = runPathStr.substr(0,pos);
 				//DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM)("get rvc path is %s",m_rootPath.c_str());
 			}else{
@@ -1449,12 +1433,7 @@ void UploadFSM::scanFile()
 		//构建初始的扫描根路径
 		string path="";
 		if(up->path_type=="R"){
-			//TODO: CrossPlaform  [Gifur@2025730]
-#ifdef RVC_OS_WIN
-			path = m_rootPath + "\\" + up->path_name;
-#else
 			path = m_rootPath + SPLIT_SLASH_STR + up->path_name;
-#endif
 		}else if(up->path_type=="A"){
 			path=up->path_name;
 
@@ -1777,12 +1756,7 @@ bool UploadFSM::getFileContent(FILE* pFile,unsigned char* content,int beginPos,
 	clearerr(pFile);//尝试先复位错误指针
 #endif	
 	if(fseek(pFile,beginPos,SEEK_SET)!=0){
-		//TODO: CrossPlaform  [Gifur@2025730]
-#ifdef RVC_OS_WIN
-		DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("getFileContent fail,fseek beginPos =%d is error =%d",beginPos,(int)GetLastError());
-#else
-		DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("getFileContent fail,fseek beginPos =%d is error =%d",beginPos, errno);
-#endif
+		DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("getFileContent fail,fseek beginPos =%d is error =%d", beginPos, (int)GetLastError());
 		return false;
 	}
 	unsigned char* pRead = content;//移动的指针
@@ -1802,12 +1776,7 @@ bool UploadFSM::getFileContent(FILE* pFile,unsigned char* content,int beginPos,
 	if(pRemaind==0){
 		return true;
 	}else{
-		//TODO: CrossPlaform  [Gifur@2025730]
-#ifdef RVC_OS_WIN
-		DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("getFileContent fail,pRemaind =%d, error=%d",pRemaind,(int)GetLastError());
-#else	
-		DbgWithLink(LOG_LEVEL_INFO,LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("getFileContent fail,pRemaind =%d, error=%d",pRemaind, errno);
-#endif	
+		DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setAPI(__FUNCTION__)("getFileContent fail,pRemaind =%d, error=%d", pRemaind, (int)GetLastError());
 		return false;
 	}
 }
@@ -1839,7 +1808,7 @@ bool UploadFSM::test_zero_ref(const char *path)
 	}
 #endif // RVC_OS_WIN
 }
-//TODO: CrossPlaform  [Gifur@2025730]
+//TODO: CrossPlaform 获取完整文件长度建议用 fileutil中的ReadFileSize 这里是否有特殊情况 [Gifur@2025730]
 bool UploadFSM::GetFileLength(const char* filePath,long &fileLen)
 {
 	FILE* file = fopen(filePath, "rb");  

+ 4 - 27
Module/mod_vtmloader/VtmLoaderFSM.cpp

@@ -1698,12 +1698,7 @@ bool CVtmLoaderFSM::IsRootINIExist(CSimpleStringA& path)
 		return false;
 	}
 	path = csHardwareCfg + SPLIT_SLASH_STR + "root.ini";
-	//TODO: CrossPlaform  [Gifur@2025730]
-#if defined(RVC_OS_WIN)
-	if (_access(path.GetData(), 0) == 0) {
-#else
-	if (access(path.GetData(), F_OK) == 0) {
-#endif
+	if(ExistsFileA(path)) {
 		return true;
 	}
 	else
@@ -2924,12 +2919,7 @@ bool CVtmLoaderFSM::CheckIfNeedCopyDepFiles()
 		return false;
 	}
 	csPath = csRun + SPLIT_SLASH_STR + "dep" + SPLIT_SLASH_STR + "depver.txt";
-	//TODO: CrossPlaform  [Gifur@2025730]
-#if defined(RVC_OS_WIN)
-	if (_access(csPath.GetData(), 0) == 0) {
-#else
-	if (access(csPath.GetData(), F_OK) == 0) {
-#endif
+	if(ExistsFileA(csPath)) {
 		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("depver.txt(%s) exist, no need to do dep copy.", csPath.GetData());
 		return false;
 	}
@@ -2953,12 +2943,8 @@ void CVtmLoaderFSM::CopyDepFilesToNewDepPath()
 	csPath = csRun + SPLIT_SLASH_STR + "dep" + SPLIT_SLASH_STR + "0.0.0.1";
 
 	if (!CreateDirA(csPath.GetData(), TRUE))
-	{//TODO: CrossPlaform  [Gifur@2025730]
-#ifdef RVC_OS_WIN
+	{
 		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Create default dep version dir fail: %d", GetLastError());
-#else
-		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("Create default dep version dir fail: %d", errno);
-#endif	
 		m_eDepCopyStage = DepDirInitCopy_CopyFailed;
 		return;
 	}
@@ -3056,19 +3042,10 @@ void CVtmLoaderFSM::DoSpecialJobInTestRoom()
 
 		spRunCfg->WriteConfigValue(GetEntityBase()->GetEntityName(), "HaveSwitchVerTo", csSwitchVerTo.GetData());
 
-
 		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM)("write version [%s] succeed", csSwitchVerTo.GetData());
-
-		//TODO: CrossPlaform 抽成一个宏方便一点  [Gifur@2025730]
-#if defined(RVC_OS_LINUX)
 		if (bSetSucc) {
-			mode_t f_attrib = S_IRUSR | S_IWUSR | S_IXUSR | S_IRGRP | S_IWGRP | S_IXGRP | S_IROTH | S_IXOTH | S_IWOTH;
-			chmod(csActiveFilePath.GetData(), f_attrib);
-		}
-		else {
-			DbgWithLink(LOG_LEVEL_ERROR, LOG_TYPE_SYSTEM)("bSetSucc fail");
+			SureUnixFileAttributeAccessable(csActiveFilePath);
 		}
-#endif //RVC_OS_LINUX
 		Sleep(10000);
 		GetEntityBase()->GetFunction()->GetPrivilegeFunction()->Reboot(RebootTrigger_ManualLocal, RebootWayEnum::RebootWay_Framework);
 	}