diff options
author | Craig Tiller <ctiller@google.com> | 2016-05-05 17:11:31 -0700 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2016-05-05 17:11:31 -0700 |
commit | ddad97899654c1eb3805ec165e842f8f465702a1 (patch) | |
tree | 33e02e273656ba1306b023936c4206a164ff2a3a /src/core | |
parent | 804ff719e3a512e4a2f6c3a9585f528917c2fd93 (diff) |
API fuzzer compiles with new error handling
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/lib/iomgr/error.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/core/lib/iomgr/error.c b/src/core/lib/iomgr/error.c index 2c5f9f6cbd..fb8decb8d3 100644 --- a/src/core/lib/iomgr/error.c +++ b/src/core/lib/iomgr/error.c @@ -229,6 +229,10 @@ grpc_error *grpc_error_set_int(grpc_error *src, grpc_error_ints which, return new; } +const intptr_t *grpc_error_get_int(grpc_error *err, grpc_error_ints which) { + return gpr_avl_get(err->ints, (void *)(uintptr_t)which); +} + grpc_error *grpc_error_set_str(grpc_error *src, grpc_error_strs which, const char *value) { grpc_error *new = copy_error_and_unref(src); @@ -419,6 +423,13 @@ static const char *finish_kvs(kv_pairs *kvs) { return s; } +void grpc_error_free_string(const char *str) { + if (str == no_error_string) return; + if (str == oom_error_string) return; + if (str == cancelled_error_string) return; + gpr_free((char *)str); +} + const char *grpc_error_string(grpc_error *err) { if (err == GRPC_ERROR_NONE) return no_error_string; if (err == GRPC_ERROR_OOM) return oom_error_string; |