From ae600238bc9fb49dafeedb60412e92e40591d7c4 Mon Sep 17 00:00:00 2001 From: YuQing <384681@qq.com> Date: Fri, 5 Mar 2021 11:25:21 +0800 Subject: [PATCH] add ENODATA convert --- src/sf_define.h | 1 + src/sf_util.c | 2 ++ src/sf_util.h | 4 ++++ 3 files changed, 7 insertions(+) diff --git a/src/sf_define.h b/src/sf_define.h index 6028ec2..63ea672 100644 --- a/src/sf_define.h +++ b/src/sf_define.h @@ -60,6 +60,7 @@ #define SF_ERROR_EAGAIN 8835 #define SF_ERROR_EOVERFLOW 8884 #define SF_ERROR_EOPNOTSUPP 8895 +#define SF_ERROR_ENODATA 8861 #define SF_FORCE_CLOSE_CONNECTION_ERROR_MIN SF_RETRIABLE_ERROR_NOT_MASTER #define SF_FORCE_CLOSE_CONNECTION_ERROR_MAX SF_RETRIABLE_ERROR_MAX diff --git a/src/sf_util.c b/src/sf_util.c index 19a1f5e..1e7dae8 100644 --- a/src/sf_util.c +++ b/src/sf_util.c @@ -189,6 +189,8 @@ const char *sf_strerror(const int errnum) return STRERROR(EAGAIN); case SF_ERROR_EOVERFLOW: return STRERROR(EOVERFLOW); + case SF_ERROR_ENODATA: + return STRERROR(ENODATA); default: return STRERROR(errnum); } diff --git a/src/sf_util.h b/src/sf_util.h index 7ede9ff..9f7a2d4 100644 --- a/src/sf_util.h +++ b/src/sf_util.h @@ -103,6 +103,8 @@ static inline int sf_unify_errno(const int errnum) return SF_ERROR_EOVERFLOW; case EOPNOTSUPP: return SF_ERROR_EOPNOTSUPP; + case ENODATA: + return SF_ERROR_ENODATA; default: return errnum; } @@ -121,6 +123,8 @@ static inline int sf_localize_errno(const int errnum) return EOVERFLOW; case SF_ERROR_EOPNOTSUPP: return EOPNOTSUPP; + case SF_ERROR_ENODATA: + return ENODATA; default: return errnum; }