refact error code
This commit is contained in:
parent
9c5dbab91e
commit
d08cd42c8a
|
@ -18,6 +18,8 @@
|
|||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "osDef.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
@ -46,11 +48,11 @@ const char* terrstr();
|
|||
char* taosGetErrMsgReturn();
|
||||
char* taosGetErrMsg();
|
||||
int32_t* taosGetErrno();
|
||||
int32_t* taosGetErrln();
|
||||
int32_t taosGetErrSize();
|
||||
#define terrno (*taosGetErrno())
|
||||
#define terrln (*taosGetErrln())
|
||||
#define terrMsg (taosGetErrMsg())
|
||||
|
||||
extern threadlocal int32_t terrno;
|
||||
extern threadlocal int32_t terrln;
|
||||
extern threadlocal char terrMsg[ERR_MSG_LEN];
|
||||
|
||||
#define SET_ERROR_MSG(MSG, ...) \
|
||||
snprintf(terrMsg, ERR_MSG_LEN, MSG, ##__VA_ARGS__)
|
||||
|
|
|
@ -21,14 +21,14 @@
|
|||
|
||||
#define TAOS_ERROR_C
|
||||
|
||||
static threadlocal int32_t tsErrno;
|
||||
static threadlocal int32_t tsErrln;
|
||||
static threadlocal char tsErrMsgDetail[ERR_MSG_LEN] = {0};
|
||||
threadlocal int32_t terrno;
|
||||
threadlocal int32_t terrln;
|
||||
threadlocal char terrMsg[ERR_MSG_LEN];
|
||||
|
||||
static threadlocal char tsErrMsgReturn[ERR_MSG_LEN] = {0};
|
||||
|
||||
int32_t* taosGetErrno() { return &tsErrno; }
|
||||
int32_t* taosGetErrln() { return &tsErrln; }
|
||||
char* taosGetErrMsg() { return tsErrMsgDetail; }
|
||||
int32_t* taosGetErrno() { return &terrno; }
|
||||
char* taosGetErrMsg() { return terrMsg; }
|
||||
char* taosGetErrMsgReturn() { return tsErrMsgReturn; }
|
||||
|
||||
#ifdef TAOS_ERROR_C
|
||||
|
|
Loading…
Reference in New Issue