[TBASE-1230]

This commit is contained in:
slguan 2019-11-24 19:48:46 +08:00
parent 960aae4f09
commit 5e007a8e3e
2 changed files with 11 additions and 0 deletions

View File

@ -224,6 +224,7 @@ int64_t str2int64(char *str);
void taosSetCoreDump(); void taosSetCoreDump();
void taosBlockSIGPIPE();
#define BUILDIN_CLZL(val) __builtin_clzl(val) #define BUILDIN_CLZL(val) __builtin_clzl(val)
#define BUILDIN_CLZ(val) __builtin_clz(val) #define BUILDIN_CLZ(val) __builtin_clz(val)

View File

@ -341,3 +341,13 @@ bool taosSkipSocketCheck() {
return false; return false;
} }
void taosBlockSIGPIPE() {
sigset_t signal_mask;
sigemptyset(&signal_mask);
sigaddset(&signal_mask, SIGPIPE);
int rc = pthread_sigmask(SIG_BLOCK, &signal_mask, NULL);
if (rc != 0) {
pError("failed to block SIGPIPE");
}
}