Looks good to me. Thanks! On Fri, Jan 13, 2012 at 2:53 PM, Steven Dake <sdake@xxxxxxxxxx> wrote: > Requires Reviewed-by from Andrew Beekhof > > Signed-off-by: Steven Dake <sdake@xxxxxxxxxx> > --- > include/corosync/corotypes.h | 100 ++++++++++++++++++++++++++++++++++++++++++ > lib/util.h | 99 ----------------------------------------- > 2 files changed, 100 insertions(+), 99 deletions(-) > > diff --git a/include/corosync/corotypes.h b/include/corosync/corotypes.h > index acae884..74183d8 100644 > --- a/include/corosync/corotypes.h > +++ b/include/corosync/corotypes.h > @@ -268,5 +268,105 @@ static inline cs_error_t qb_to_cs_error (int result) > #define QUORUM_ERR_SECURITY CS_ERR_SECURITY > #define quorum_error_t cs_error_t > > +/* > + * static inline so multiple libraries can link into same binary > + */ > +static inline const char * cs_strerror(cs_error_t err) > +{ > + switch (err) { > + case CS_OK: > + return "success"; > + > + case CS_ERR_LIBRARY: > + return "CS_ERR_LIBRARY"; > + > + case CS_ERR_VERSION: > + return "CS_ERR_VERSION"; > + > + case CS_ERR_INIT: > + return "CS_ERR_INIT"; > + > + case CS_ERR_NO_MEMORY: > + return "CS_ERR_NO_MEMORY"; > + > + case CS_ERR_NAME_TOO_LONG : > + return "CS_ERR_NAME_TOO_LONG "; > + > + case CS_ERR_TIMEOUT: > + return "CS_ERR_TIMEOUT"; > + > + case CS_ERR_TRY_AGAIN: > + return "CS_ERR_TRY_AGAIN"; > + > + case CS_ERR_INVALID_PARAM: > + return "CS_ERR_INVALID_PARAM"; > + > + case CS_ERR_BAD_HANDLE: > + return "CS_ERR_BAD_HANDLE"; > + > + case CS_ERR_BUSY : > + return "CS_ERR_BUSY "; > + > + case CS_ERR_ACCESS : > + return "CS_ERR_ACCESS "; > + > + case CS_ERR_NOT_EXIST : > + return "CS_ERR_NOT_EXIST "; > + > + case CS_ERR_EXIST : > + return "CS_ERR_EXIST "; > + > + case CS_ERR_NO_SPACE : > + return "CS_ERR_NO_SPACE "; > + > + case CS_ERR_INTERRUPT : > + return "CS_ERR_INTERRUPT "; > + > + case CS_ERR_NAME_NOT_FOUND : > + return "CS_ERR_NAME_NOT_FOUND "; > + > + case CS_ERR_NO_RESOURCES : > + return "CS_ERR_NO_RESOURCES "; > + > + case CS_ERR_NOT_SUPPORTED : > + return "CS_ERR_NOT_SUPPORTED "; > + > + case CS_ERR_BAD_OPERATION : > + return "CS_ERR_BAD_OPERATION "; > + > + case CS_ERR_FAILED_OPERATION : > + return "CS_ERR_FAILED_OPERATION "; > + > + case CS_ERR_MESSAGE_ERROR : > + return "CS_ERR_MESSAGE_ERROR "; > + > + case CS_ERR_QUEUE_FULL : > + return "CS_ERR_QUEUE_FULL "; > + > + case CS_ERR_QUEUE_NOT_AVAILABLE : > + return "CS_ERR_QUEUE_NOT_AVAILABLE "; > + > + case CS_ERR_BAD_FLAGS : > + return "CS_ERR_BAD_FLAGS "; > + > + case CS_ERR_TOO_BIG : > + return "CS_ERR_TOO_BIG "; > + > + case CS_ERR_NO_SECTIONS : > + return "CS_ERR_NO_SECTIONS "; > + > + case CS_ERR_CONTEXT_NOT_FOUND : > + return "CS_ERR_CONTEXT_NOT_FOUND "; > + > + case CS_ERR_TOO_MANY_GROUPS : > + return "CS_ERR_TOO_MANY_GROUPS "; > + > + case CS_ERR_SECURITY : > + return "CS_ERR_SECURITY "; > + > + default: > + return "unknown error"; > + } > +} > #endif /* COROTYPES_H_DEFINED */ > > diff --git a/lib/util.h b/lib/util.h > index a5b0053..1d812fa 100644 > --- a/lib/util.h > +++ b/lib/util.h > @@ -50,103 +50,4 @@ > #define IPC_DISPATCH_SIZE 8192*128 > #endif /* HAVE_SMALL_MEMORY_FOOTPRINT */ > > -static inline const char * cs_strerror(cs_error_t err) > -{ > - switch (err) { > - case CS_OK: > - return "success"; > - > - case CS_ERR_LIBRARY: > - return "CS_ERR_LIBRARY"; > - > - case CS_ERR_VERSION: > - return "CS_ERR_VERSION"; > - > - case CS_ERR_INIT: > - return "CS_ERR_INIT"; > - > - case CS_ERR_NO_MEMORY: > - return "CS_ERR_NO_MEMORY"; > - > - case CS_ERR_NAME_TOO_LONG : > - return "CS_ERR_NAME_TOO_LONG "; > - > - case CS_ERR_TIMEOUT: > - return "CS_ERR_TIMEOUT"; > - > - case CS_ERR_TRY_AGAIN: > - return "CS_ERR_TRY_AGAIN"; > - > - case CS_ERR_INVALID_PARAM: > - return "CS_ERR_INVALID_PARAM"; > - > - case CS_ERR_BAD_HANDLE: > - return "CS_ERR_BAD_HANDLE"; > - > - case CS_ERR_BUSY : > - return "CS_ERR_BUSY "; > - > - case CS_ERR_ACCESS : > - return "CS_ERR_ACCESS "; > - > - case CS_ERR_NOT_EXIST : > - return "CS_ERR_NOT_EXIST "; > - > - case CS_ERR_EXIST : > - return "CS_ERR_EXIST "; > - > - case CS_ERR_NO_SPACE : > - return "CS_ERR_NO_SPACE "; > - > - case CS_ERR_INTERRUPT : > - return "CS_ERR_INTERRUPT "; > - > - case CS_ERR_NAME_NOT_FOUND : > - return "CS_ERR_NAME_NOT_FOUND "; > - > - case CS_ERR_NO_RESOURCES : > - return "CS_ERR_NO_RESOURCES "; > - > - case CS_ERR_NOT_SUPPORTED : > - return "CS_ERR_NOT_SUPPORTED "; > - > - case CS_ERR_BAD_OPERATION : > - return "CS_ERR_BAD_OPERATION "; > - > - case CS_ERR_FAILED_OPERATION : > - return "CS_ERR_FAILED_OPERATION "; > - > - case CS_ERR_MESSAGE_ERROR : > - return "CS_ERR_MESSAGE_ERROR "; > - > - case CS_ERR_QUEUE_FULL : > - return "CS_ERR_QUEUE_FULL "; > - > - case CS_ERR_QUEUE_NOT_AVAILABLE : > - return "CS_ERR_QUEUE_NOT_AVAILABLE "; > - > - case CS_ERR_BAD_FLAGS : > - return "CS_ERR_BAD_FLAGS "; > - > - case CS_ERR_TOO_BIG : > - return "CS_ERR_TOO_BIG "; > - > - case CS_ERR_NO_SECTIONS : > - return "CS_ERR_NO_SECTIONS "; > - > - case CS_ERR_CONTEXT_NOT_FOUND : > - return "CS_ERR_CONTEXT_NOT_FOUND "; > - > - case CS_ERR_TOO_MANY_GROUPS : > - return "CS_ERR_TOO_MANY_GROUPS "; > - > - case CS_ERR_SECURITY : > - return "CS_ERR_SECURITY "; > - > - default: > - return "unknown error"; > - } > -} > - > - > #endif /* COROSYNC_UTIL_H_DEFINED */ > -- > 1.7.7.5 > > _______________________________________________ > discuss mailing list > discuss@xxxxxxxxxxxx > http://lists.corosync.org/mailman/listinfo/discuss _______________________________________________ discuss mailing list discuss@xxxxxxxxxxxx http://lists.corosync.org/mailman/listinfo/discuss