Merge pull request #10639 from taosdata/fix/ZhiqiangWang/TD-13876-forbid-big-end-machine

[TD-13876]<fix>: forbid big-end machine.
This commit is contained in:
Zhiqiang Wang 2022-03-09 11:09:19 +08:00 committed by GitHub
commit 290c04d717
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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)
/*