added LOG_TEST_GOTO_ERR and SC_TEST_GOTO_ERR

Don't forget to set the error label!
This commit is contained in:
Frank Morgner 2015-04-24 18:13:34 +02:00 committed by Viktor Tarasov
parent 689ece205a
commit 6523f3fcb9
1 changed files with 10 additions and 0 deletions

View File

@ -89,6 +89,16 @@ char * sc_dump_oid(const struct sc_object_id *oid);
} while(0)
#define LOG_TEST_RET(ctx, r, text) SC_TEST_RET((ctx), SC_LOG_DEBUG_NORMAL, (r), (text))
#define SC_TEST_GOTO_ERR(ctx, level, r, text) do { \
int _ret = (r); \
if (_ret < 0) { \
sc_do_log(ctx, level, __FILE__, __LINE__, __FUNCTION__, \
"%s: %d (%s)\n", (text), _ret, sc_strerror(_ret)); \
goto err; \
} \
} while(0)
#define LOG_TEST_GOTO_ERR(ctx, r, text) SC_TEST_GOTO_ERR((ctx), SC_LOG_DEBUG_NORMAL, (r), (text))
#ifdef __cplusplus
}
#endif