convert errno EBUSY

connection_manager
YuQing 2021-01-12 17:58:19 +08:00
parent 20b0cee201
commit 077c29e2b6
2 changed files with 6 additions and 1 deletions

View File

@ -54,7 +54,8 @@
#define SF_RETRIABLE_ERROR_CHANNEL_INVALID 9915 //client should re-setup channel
//std errno wrapper for crossing platform
#define SF_ERROR_EINVAL 8811
#define SF_ERROR_EBUSY 8816
#define SF_ERROR_EINVAL 8822
#define SF_ERROR_EAGAIN 8835
#define SF_ERROR_EOVERFLOW 8884

View File

@ -93,6 +93,8 @@ static inline void sf_setup_schedule(struct log_context *pContext,
static inline int sf_unify_errno(const int errnum)
{
switch (errnum) {
case EBUSY:
return SF_ERROR_EBUSY;
case EINVAL:
return SF_ERROR_EINVAL;
case EAGAIN:
@ -107,6 +109,8 @@ static inline int sf_unify_errno(const int errnum)
static inline int sf_localize_errno(const int errnum)
{
switch (errnum) {
case SF_ERROR_EBUSY:
return EBUSY;
case SF_ERROR_EINVAL:
return EINVAL;
case SF_ERROR_EAGAIN: