mirror of
https://git.proxmox.com/git/mirror_corosync
synced 2025-10-04 07:57:45 +00:00
move hdb_error_to_cs to common_lib
Note the previous inconsistent implementation. Signed-off-by: Angus Salkeld <asalkeld@redhat.com> Reviewed-by: Steven Dake <sdake@redhat.com>
This commit is contained in:
parent
da483b8121
commit
6cd576b0f5
@ -111,4 +111,21 @@ cs_error_t qb_to_cs_error (int result)
|
||||
return err;
|
||||
}
|
||||
|
||||
cs_error_t hdb_error_to_cs (int res)
|
||||
{
|
||||
if (res == 0) {
|
||||
return (CS_OK);
|
||||
} else {
|
||||
if (res == -EBADF) {
|
||||
return (CS_ERR_BAD_HANDLE);
|
||||
} else if (res == -ENOMEM) {
|
||||
return (CS_ERR_NO_MEMORY);
|
||||
} else if (res == -EMFILE) {
|
||||
return (CS_ERR_NO_RESOURCES);
|
||||
} else if (res == -EACCES) {
|
||||
return (CS_ERR_ACCESS);
|
||||
}
|
||||
return (CS_ERR_LIBRARY);
|
||||
}
|
||||
}
|
||||
|
||||
|
21
exec/util.h
21
exec/util.h
@ -67,26 +67,7 @@ enum e_corosync_done {
|
||||
COROSYNC_DONE_SERVICE_ENGINE_INIT = 20
|
||||
};
|
||||
|
||||
static inline cs_error_t hdb_error_to_cs (int res) \
|
||||
{ \
|
||||
if (res == 0) { \
|
||||
return (CS_OK); \
|
||||
} else { \
|
||||
if (res == -EBADF) { \
|
||||
return (CS_ERR_BAD_HANDLE); \
|
||||
} else \
|
||||
if (res == -ENOMEM) { \
|
||||
return (CS_ERR_NO_MEMORY); \
|
||||
} else \
|
||||
if (res == -EMFILE) { \
|
||||
return (CS_ERR_NO_RESOURCES); \
|
||||
} else \
|
||||
if (res == -EACCES) { \
|
||||
return (CS_ERR_ACCESS); \
|
||||
} \
|
||||
return (CS_ERR_LIBRARY); \
|
||||
} \
|
||||
}
|
||||
cs_error_t hdb_error_to_cs (int res);
|
||||
|
||||
/**
|
||||
* Compare two names. returns non-zero on match.
|
||||
|
@ -38,7 +38,7 @@
|
||||
|
||||
#include <corosync/corotypes.h>
|
||||
|
||||
#define hdb_error_to_cs(_result_) qb_to_cs_error(_result_)
|
||||
cs_error_t hdb_error_to_cs (int res);
|
||||
|
||||
#ifdef HAVE_SMALL_MEMORY_FOOTPRINT
|
||||
#define IPC_REQUEST_SIZE 1024*64
|
||||
|
Loading…
Reference in New Issue
Block a user