From 7b97fc335541160f1303ff2fbb0758a9748ba9b4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Daniel=20Kou=C5=99il?= Date: Tue, 6 Dec 2011 10:13:28 +0000 Subject: [PATCH] make canl_set_err() return appropriate error code --- emi.canl.canl-c/src/canl_err.c | 4 ++-- emi.canl.canl-c/src/canl_locl.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/emi.canl.canl-c/src/canl_err.c b/emi.canl.canl-c/src/canl_err.c index f5db3f2..f2318d9 100644 --- a/emi.canl.canl-c/src/canl_err.c +++ b/emi.canl.canl-c/src/canl_err.c @@ -55,7 +55,7 @@ void update_error (glb_ctx *cc, const char *err_format, ...) } /* If there was some error message in ctx, delete it and make new */ -void set_error (glb_ctx *cc, unsigned long err_code, CANL_ERROR_ORIGIN err_orig, +int set_error (glb_ctx *cc, unsigned long err_code, CANL_ERROR_ORIGIN err_orig, const char *err_format, ...) { va_list ap; @@ -74,7 +74,7 @@ void set_error (glb_ctx *cc, unsigned long err_code, CANL_ERROR_ORIGIN err_orig, //0 is not error if (!err_code) return; - resolve_error(cc, err_code, err_orig); + return resolve_error(cc, err_code, err_orig); } /* Delete error message in ctx, suppose msg is not empty.Set pointer to NULL*/ diff --git a/emi.canl.canl-c/src/canl_locl.h b/emi.canl.canl-c/src/canl_locl.h index 68a06b2..7bb5042 100644 --- a/emi.canl.canl-c/src/canl_locl.h +++ b/emi.canl.canl-c/src/canl_locl.h @@ -51,7 +51,7 @@ typedef struct _io_handler } io_handler; void reset_error (glb_ctx *cc, unsigned long err_code); -void set_error (glb_ctx *cc, unsigned long err_code, CANL_ERROR_ORIGIN err_orig, +int set_error (glb_ctx *cc, unsigned long err_code, CANL_ERROR_ORIGIN err_orig, const char *err_format, ...); void update_error (glb_ctx *cc, const char *err_format, ...); void free_hostent(struct hostent *h); //TODO is there some standard funcion to free hostent? -- 1.8.2.3