From 0609e7481a2c2ab475ebd3cba60ce88eb53ddd20 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Bollo?= Date: Fri, 5 May 2017 12:26:13 +0200 Subject: [PATCH] make function afb_context_set return a status MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Change-Id: I5172c58288e5974001f3478f7cee94d7a98abe7d Signed-off-by: José Bollo --- src/afb-context.c | 6 ++---- src/afb-context.h | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/afb-context.c b/src/afb-context.c index e9c73de5..16dcd046 100644 --- a/src/afb-context.c +++ b/src/afb-context.c @@ -122,12 +122,10 @@ void *afb_context_get(struct afb_context *context) return afb_session_get_cookie(context->session, context->api_key); } -void afb_context_set(struct afb_context *context, void *value, void (*free_value)(void*)) +int afb_context_set(struct afb_context *context, void *value, void (*free_value)(void*)) { - int rc; assert(context->session != NULL); - rc = afb_session_set_cookie(context->session, context->api_key, value, free_value); - (void)rc; /* TODO */ + return afb_session_set_cookie(context->session, context->api_key, value, free_value); } void afb_context_close(struct afb_context *context) diff --git a/src/afb-context.h b/src/afb-context.h index 55605858..5f007f9c 100644 --- a/src/afb-context.h +++ b/src/afb-context.h @@ -46,7 +46,7 @@ extern const char *afb_context_sent_token(struct afb_context *context); extern const char *afb_context_sent_uuid(struct afb_context *context); extern void *afb_context_get(struct afb_context *context); -extern void afb_context_set(struct afb_context *context, void *value, void (*free_value)(void*)); +extern int afb_context_set(struct afb_context *context, void *value, void (*free_value)(void*)); extern void *afb_context_data(struct afb_context *context, void *(*make_value)(void), void (*free_value)(void*)); extern void afb_context_close(struct afb_context *context); -- 2.16.6