提交 586b73be 编写于 作者: D dapan1121

fix: windows compile issue

上级 8ff3b2fd
...@@ -393,8 +393,10 @@ void taosClientCrash(int signum, void *sigInfo, void *context) { ...@@ -393,8 +393,10 @@ void taosClientCrash(int signum, void *sigInfo, void *context) {
taosIgnSignal(SIGHUP); taosIgnSignal(SIGHUP);
taosIgnSignal(SIGINT); taosIgnSignal(SIGINT);
taosIgnSignal(SIGBREAK); taosIgnSignal(SIGBREAK);
#if !defined(WINDOWS)
taosIgnSignal(SIGBUS); taosIgnSignal(SIGBUS);
#endif
taosIgnSignal(SIGABRT); taosIgnSignal(SIGABRT);
taosIgnSignal(SIGFPE); taosIgnSignal(SIGFPE);
taosIgnSignal(SIGSEGV); taosIgnSignal(SIGSEGV);
...@@ -504,7 +506,9 @@ void tscStopCrashReport() { ...@@ -504,7 +506,9 @@ void tscStopCrashReport() {
} }
static void tscSetSignalHandle() { static void tscSetSignalHandle() {
#if !defined(WINDOWS)
taosSetSignal(SIGBUS, taosClientCrash); taosSetSignal(SIGBUS, taosClientCrash);
#endif
taosSetSignal(SIGABRT, taosClientCrash); taosSetSignal(SIGABRT, taosClientCrash);
taosSetSignal(SIGFPE, taosClientCrash); taosSetSignal(SIGFPE, taosClientCrash);
taosSetSignal(SIGSEGV, taosClientCrash); taosSetSignal(SIGSEGV, taosClientCrash);
......
...@@ -73,8 +73,10 @@ void dmLogCrash(int signum, void *sigInfo, void *context) { ...@@ -73,8 +73,10 @@ void dmLogCrash(int signum, void *sigInfo, void *context) {
taosIgnSignal(SIGHUP); taosIgnSignal(SIGHUP);
taosIgnSignal(SIGINT); taosIgnSignal(SIGINT);
taosIgnSignal(SIGBREAK); taosIgnSignal(SIGBREAK);
#ifndef WINDOWS
taosIgnSignal(SIGBUS); taosIgnSignal(SIGBUS);
#endif
taosIgnSignal(SIGABRT); taosIgnSignal(SIGABRT);
taosIgnSignal(SIGFPE); taosIgnSignal(SIGFPE);
taosIgnSignal(SIGSEGV); taosIgnSignal(SIGSEGV);
...@@ -111,7 +113,9 @@ static void dmSetSignalHandle() { ...@@ -111,7 +113,9 @@ static void dmSetSignalHandle() {
taosSetSignal(SIGQUIT, dmStopDnode); taosSetSignal(SIGQUIT, dmStopDnode);
#endif #endif
#ifndef WINDOWS
taosSetSignal(SIGBUS, dmLogCrash); taosSetSignal(SIGBUS, dmLogCrash);
#endif
taosSetSignal(SIGABRT, dmLogCrash); taosSetSignal(SIGABRT, dmLogCrash);
taosSetSignal(SIGFPE, dmLogCrash); taosSetSignal(SIGFPE, dmLogCrash);
taosSetSignal(SIGSEGV, dmLogCrash); taosSetSignal(SIGSEGV, dmLogCrash);
......
...@@ -899,7 +899,7 @@ void taosLogCrashInfo(char* nodeType, char* pMsg, int64_t msgLen, int signum, vo ...@@ -899,7 +899,7 @@ void taosLogCrashInfo(char* nodeType, char* pMsg, int64_t msgLen, int signum, vo
int64_t writeSize = taosWriteFile(pFile, &msgLen, sizeof(msgLen)); int64_t writeSize = taosWriteFile(pFile, &msgLen, sizeof(msgLen));
if (sizeof(msgLen) != writeSize) { if (sizeof(msgLen) != writeSize) {
taosUnLockFile(pFile); taosUnLockFile(pFile);
taosPrintLog(flags, level, dflag, "failed to write len to file:%s,%p wlen:%" PRId64 " tlen:%" PRId64 " since %s", taosPrintLog(flags, level, dflag, "failed to write len to file:%s,%p wlen:%" PRId64 " tlen:%lu since %s",
filepath, pFile, writeSize, sizeof(msgLen), terrstr()); filepath, pFile, writeSize, sizeof(msgLen), terrstr());
goto _return; goto _return;
} }
...@@ -977,7 +977,7 @@ void taosReadCrashInfo(char* filepath, char** pMsg, int64_t* pMsgLen, TdFilePtr* ...@@ -977,7 +977,7 @@ void taosReadCrashInfo(char* filepath, char** pMsg, int64_t* pMsgLen, TdFilePtr*
if (sizeof(msgLen) != readSize) { if (sizeof(msgLen) != readSize) {
truncateFile = true; truncateFile = true;
if (readSize < 0) { if (readSize < 0) {
taosPrintLog(flags, level, dflag, "failed to read len from file:%s,%p wlen:%" PRId64 " tlen:%" PRId64 " since %s", taosPrintLog(flags, level, dflag, "failed to read len from file:%s,%p wlen:%" PRId64 " tlen:%lu since %s",
filepath, pFile, readSize, sizeof(msgLen), terrstr()); filepath, pFile, readSize, sizeof(msgLen), terrstr());
} }
goto _return; goto _return;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册