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:
commit
290c04d717
|
@ -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() {
|
||||||
}
|
}
|
||||||
|
|
||||||
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 @@
|
||||||
#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)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in New Issue