提交 6667446d 编写于 作者: wafwerar's avatar wafwerar

[TD-13876]<fix>: forbid big-end machine.

上级 9369a7a5
...@@ -33,6 +33,7 @@ typedef struct { ...@@ -33,6 +33,7 @@ typedef struct {
SDiskSize size; SDiskSize size;
} SDiskSpace; } SDiskSpace;
bool taosCheckSystemIsSmallEnd();
void taosGetSystemInfo(); void taosGetSystemInfo();
int32_t taosGetEmail(char *email, int32_t maxLen); int32_t taosGetEmail(char *email, int32_t maxLen);
int32_t taosGetOsReleaseName(char *releaseName, int32_t maxLen); int32_t taosGetOsReleaseName(char *releaseName, int32_t maxLen);
......
...@@ -97,6 +97,11 @@ int32_t dmnRunDnode() { ...@@ -97,6 +97,11 @@ int32_t dmnRunDnode() {
} }
int main(int argc, char const *argv[]) { int main(int argc, char const *argv[]) {
if (!taosCheckSystemIsSmallEnd()) {
uError("TDengine does not run on non-small-end machines.");
return -1;
}
if (dmnParseOption(argc, argv) != 0) { if (dmnParseOption(argc, argv) != 0) {
return -1; return -1;
} }
......
...@@ -16,6 +16,15 @@ ...@@ -16,6 +16,15 @@
#define _DEFAULT_SOURCE #define _DEFAULT_SOURCE
#include "os.h" #include "os.h"
bool taosCheckSystemIsSmallEnd() {
union check{
int16_t i;
char ch[2];
}c;
c.i=1;
return c.ch[0]==1;
}
#if defined(_TD_WINDOWS_64) || defined(_TD_WINDOWS_32) #if defined(_TD_WINDOWS_64) || defined(_TD_WINDOWS_32)
/* /*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册