From: Daniel KouĊ™il Date: Tue, 6 Dec 2011 10:13:28 +0000 (+0000) Subject: make canl_set_err() return appropriate error code X-Git-Tag: merge_30_head_take2_after~39 X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=7b97fc335541160f1303ff2fbb0758a9748ba9b4;p=jra1mw.git make canl_set_err() return appropriate error code --- 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?