Merge pull request #29795 from taosdata/fix/TD-33747
fix: compile error in lower gcc version
This commit is contained in:
commit
7bf091bc91
|
@ -87,6 +87,8 @@ static TdThread timerThread;
|
||||||
static timer_t timerId;
|
static timer_t timerId;
|
||||||
static volatile bool stopTimer = false;
|
static volatile bool stopTimer = false;
|
||||||
|
|
||||||
|
#pragma GCC diagnostic push
|
||||||
|
#pragma GCC diagnostic ignored "-Wstringop-overflow"
|
||||||
static void *taosProcessAlarmSignal(void *tharg) {
|
static void *taosProcessAlarmSignal(void *tharg) {
|
||||||
// Block the signal
|
// Block the signal
|
||||||
sigset_t sigset;
|
sigset_t sigset;
|
||||||
|
@ -110,8 +112,8 @@ static void *taosProcessAlarmSignal(void *tharg) {
|
||||||
sevent.sigev_signo = SIGALRM;
|
sevent.sigev_signo = SIGALRM;
|
||||||
|
|
||||||
if (timer_create(CLOCK_REALTIME, &sevent, &timerId) == -1) {
|
if (timer_create(CLOCK_REALTIME, &sevent, &timerId) == -1) {
|
||||||
terrno = TAOS_SYSTEM_ERROR(errno);
|
terrno = TAOS_SYSTEM_ERROR(errno);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
taosThreadCleanupPush(taosDeleteTimer, &timerId);
|
taosThreadCleanupPush(taosDeleteTimer, &timerId);
|
||||||
|
@ -128,7 +130,7 @@ static void *taosProcessAlarmSignal(void *tharg) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
int signo;
|
int signo;
|
||||||
int32_t code = 0;
|
int32_t code = 0;
|
||||||
while (!stopTimer) {
|
while (!stopTimer) {
|
||||||
code = sigwait(&sigset, &signo);
|
code = sigwait(&sigset, &signo);
|
||||||
|
@ -145,6 +147,7 @@ static void *taosProcessAlarmSignal(void *tharg) {
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int taosInitTimer(void (*callback)(int), int ms) {
|
int taosInitTimer(void (*callback)(int), int ms) {
|
||||||
|
|
|
@ -1267,6 +1267,9 @@ void *shellCancelHandler(void *arg) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#pragma GCC diagnostic push
|
||||||
|
#pragma GCC diagnostic ignored "-Wstringop-overflow"
|
||||||
|
|
||||||
void *shellThreadLoop(void *arg) {
|
void *shellThreadLoop(void *arg) {
|
||||||
setThreadName("shellThreadLoop");
|
setThreadName("shellThreadLoop");
|
||||||
taosGetOldTerminalMode();
|
taosGetOldTerminalMode();
|
||||||
|
@ -1298,6 +1301,7 @@ void *shellThreadLoop(void *arg) {
|
||||||
taosThreadCleanupPop(1);
|
taosThreadCleanupPop(1);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
|
|
||||||
int32_t shellExecute() {
|
int32_t shellExecute() {
|
||||||
printf(shell.info.clientVersion, shell.info.cusName, taos_get_client_info(), shell.info.cusName);
|
printf(shell.info.clientVersion, shell.info.cusName, taos_get_client_info(), shell.info.cusName);
|
||||||
|
|
Loading…
Reference in New Issue