mirror of
https://git.proxmox.com/git/mirror_corosync
synced 2025-08-03 14:28:16 +00:00
add __attribute__((noreturn)) to functions that always exit.
we had some __attribute__((__noreturn__)) and some __attribute__((noreturn)) I made them all: __attribute__((noreturn)) git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2853 fd59a12c-fef9-0310-b244-a6a79926bd2f
This commit is contained in:
parent
02cddf6854
commit
4ff33854ad
@ -86,7 +86,7 @@ typedef int (*typedef_tpg_groups_send_ok) (
|
||||
static inline void _corosync_public_exit_error (cs_fatal_error_t err,
|
||||
const char *file,
|
||||
unsigned int line)
|
||||
__attribute__((__noreturn__));
|
||||
__attribute__((noreturn));
|
||||
static inline void _corosync_public_exit_error (
|
||||
cs_fatal_error_t err, const char *file, unsigned int line)
|
||||
{
|
||||
|
@ -729,7 +729,7 @@ static void log_printf_to_logs_wthread (
|
||||
sem_post (&logsys_print_finished);
|
||||
}
|
||||
|
||||
static void *logsys_worker_thread (void *data) __attribute__((__noreturn__));
|
||||
static void *logsys_worker_thread (void *data) __attribute__((noreturn));
|
||||
static void *logsys_worker_thread (void *data)
|
||||
{
|
||||
struct record *rec;
|
||||
|
@ -999,6 +999,8 @@ static void corosync_sending_allowed_release (void *sending_allowed_private_data
|
||||
static int ipc_subsys_id = -1;
|
||||
|
||||
|
||||
static void ipc_fatal_error(const char *error_msg) __attribute__((noreturn));
|
||||
|
||||
static void ipc_fatal_error(const char *error_msg) {
|
||||
_logsys_log_printf (
|
||||
LOGSYS_ENCODE_RECID(LOGSYS_LEVEL_ERROR,
|
||||
|
@ -81,12 +81,16 @@ cs_time_t clust_time_now(void)
|
||||
return time_now;
|
||||
}
|
||||
|
||||
void _corosync_out_of_memory_error (void) __attribute__((noreturn));
|
||||
void _corosync_out_of_memory_error (void)
|
||||
{
|
||||
assert (0==1);
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
|
||||
void _corosync_exit_error (
|
||||
enum e_ais_done err, const char *file, unsigned int line) __attribute__((noreturn));
|
||||
|
||||
void _corosync_exit_error (
|
||||
enum e_ais_done err, const char *file, unsigned int line)
|
||||
{
|
||||
|
@ -69,9 +69,8 @@ enum e_ais_done {
|
||||
extern int name_match(cs_name_t *name1, cs_name_t *name2);
|
||||
#define corosync_exit_error(err) _corosync_exit_error ((err), __FILE__, __LINE__)
|
||||
extern void _corosync_exit_error (enum e_ais_done err, const char *file,
|
||||
unsigned int line)
|
||||
__attribute__((__noreturn__));
|
||||
void _corosync_out_of_memory_error (void) __attribute__((__noreturn__));
|
||||
unsigned int line) __attribute__((noreturn));
|
||||
void _corosync_out_of_memory_error (void) __attribute__((noreturn));
|
||||
extern char *getcs_name_t (cs_name_t *name);
|
||||
extern void setcs_name_t (cs_name_t *name, char *str);
|
||||
extern int cs_name_tisEqual (cs_name_t *str1, char *str2);
|
||||
|
@ -69,7 +69,7 @@ struct coroipcs_init_state {
|
||||
void (*poll_dispatch_add)(int fd, void *context);
|
||||
void (*poll_dispatch_modify)(int fd, int events);
|
||||
void (*poll_dispatch_destroy)(int fd, void *context);
|
||||
void (*fatal_error)(const char *error_msg);
|
||||
void (*fatal_error)(const char *error_msg) __attribute__ ((noreturn));
|
||||
coroipcs_init_fn_lvalue (*init_fn_get)(unsigned int service);
|
||||
coroipcs_exit_fn_lvalue (*exit_fn_get)(unsigned int service);
|
||||
coroipcs_handler_fn_lvalue (*handler_fn_get)(unsigned int service, unsigned int id);
|
||||
@ -96,7 +96,7 @@ struct coroipcs_init_state_v2 {
|
||||
void (*poll_dispatch_add)(int fd, void *context);
|
||||
void (*poll_dispatch_modify)(int fd, int events);
|
||||
void (*poll_dispatch_destroy)(int fd, void *context);
|
||||
void (*fatal_error)(const char *error_msg);
|
||||
void (*fatal_error)(const char *error_msg) __attribute__ ((noreturn));
|
||||
coroipcs_init_fn_lvalue (*init_fn_get)(unsigned int service);
|
||||
coroipcs_exit_fn_lvalue (*exit_fn_get)(unsigned int service);
|
||||
coroipcs_handler_fn_lvalue (*handler_fn_get)(unsigned int service, unsigned int id);
|
||||
|
@ -591,9 +591,12 @@ struct corosync_api_v1 {
|
||||
/*
|
||||
* Error handling APIs
|
||||
*/
|
||||
void (*error_memory_failure) (void);
|
||||
void (*error_memory_failure) (void) __attribute__ ((noreturn));
|
||||
|
||||
#define corosync_fatal_error(err) api->fatal_error ((err), __FILE__, __LINE__)
|
||||
void (*fatal_error) (cs_fatal_error_t err, const char *file, unsigned int line);
|
||||
void (*fatal_error) (cs_fatal_error_t err,
|
||||
const char *file,
|
||||
unsigned int line) __attribute__ ((noreturn));
|
||||
|
||||
void (*shutdown_request) (void);
|
||||
|
||||
|
@ -159,7 +159,7 @@ static cpg_model_v1_data_t model_data = {
|
||||
.flags = CPG_MODEL_V1_DELIVER_INITIAL_TOTEM_CONF,
|
||||
};
|
||||
|
||||
static void sigintr_handler (int signum) __attribute__((__noreturn__));
|
||||
static void sigintr_handler (int signum) __attribute__((noreturn));
|
||||
static void sigintr_handler (int signum) {
|
||||
exit (0);
|
||||
}
|
||||
|
@ -151,7 +151,7 @@ static cpg_callbacks_t callbacks = {
|
||||
.cpg_confchg_fn = ConfchgCallback,
|
||||
};
|
||||
|
||||
static void sigintr_handler (int signum) __attribute__((__noreturn__));
|
||||
static void sigintr_handler (int signum) __attribute__((noreturn));
|
||||
static void sigintr_handler (int signum) {
|
||||
exit (0);
|
||||
}
|
||||
|
@ -151,7 +151,7 @@ static cpg_callbacks_t callbacks = {
|
||||
.cpg_confchg_fn = ConfchgCallback,
|
||||
};
|
||||
|
||||
static void sigintr_handler (int signum) __attribute__((__noreturn__));
|
||||
static void sigintr_handler (int signum) __attribute__((noreturn));
|
||||
static void sigintr_handler (int signum) {
|
||||
exit (0);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user