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

This commit is contained in:
afwerar 2022-03-09 10:46:31 +08:00
parent 9369a7a56d
commit 6667446db3
3 changed files with 15 additions and 0 deletions

View File

@ -33,6 +33,7 @@ typedef struct {
SDiskSize size;
} SDiskSpace;
bool taosCheckSystemIsSmallEnd();
void taosGetSystemInfo();
int32_t taosGetEmail(char *email, int32_t maxLen);
int32_t taosGetOsReleaseName(char *releaseName, int32_t maxLen);

View File

@ -97,6 +97,11 @@ int32_t dmnRunDnode() {
}
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) {
return -1;
}

View File

@ -16,6 +16,15 @@
#define _DEFAULT_SOURCE
#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)
/*