make canl_set_err() return appropriate error code
authorDaniel Kouřil <kouril@ics.muni.cz>
Tue, 6 Dec 2011 10:13:28 +0000 (10:13 +0000)
committerDaniel Kouřil <kouril@ics.muni.cz>
Tue, 6 Dec 2011 10:13:28 +0000 (10:13 +0000)
emi.canl.canl-c/src/canl_err.c
emi.canl.canl-c/src/canl_locl.h

index f5db3f2..f2318d9 100644 (file)
@@ -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*/
index 68a06b2..7bb5042 100644 (file)
@@ -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?