pacemaker  3.0.0-d8340737c4
Scalable High-Availability cluster resource manager
Functions | Variables
results.c File Reference
#include <crm_internal.h>
#include <bzlib.h>
#include <errno.h>
#include <netdb.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <qb/qbdefs.h>
#include <crm/common/mainloop.h>
#include <crm/common/xml.h>
Include dependency graph for results.c:

Go to the source code of this file.

Functions

int pcmk_result_get_strings (int code, enum pcmk_result_type type, const char **name, const char **desc)
 Get the name and description of a given result code. More...
 
int pcmk__result_bounds (enum pcmk_result_type type, int *lower, int *upper)
 
_Noreturn void pcmk__abort_as (const char *file, const char *function, int line, const char *assert_condition)
 
void crm_abort (const char *file, const char *function, int line, const char *assert_condition, gboolean do_core, gboolean do_fork)
 
const char * pcmk_errorname (int rc)
 
const char * pcmk_strerror (int rc)
 
const char * pcmk_rc_name (int rc)
 Get a return code constant name as a string. More...
 
const char * pcmk_rc_str (int rc)
 Get a user-friendly description of a return code. More...
 
int pcmk_rc2legacy (int rc)
 
int pcmk_legacy2rc (int legacy_rc)
 
const char * crm_exit_name (crm_exit_t exit_code)
 
const char * crm_exit_str (crm_exit_t exit_code)
 
crm_exit_t pcmk_rc2exitc (int rc)
 Map a function return code to the most similar exit code. More...
 
enum ocf_exitcode pcmk_rc2ocf (int rc)
 Map a function return code to the most similar OCF exit code. More...
 
int pcmk__gaierror2rc (int gai)
 Map a getaddrinfo() return code to the most similar Pacemaker return code. More...
 
int pcmk__bzlib2rc (int bz2)
 Map a bz2 return code to the most similar Pacemaker return code. More...
 
crm_exit_t crm_exit (crm_exit_t exit_status)
 
void pcmk__set_result (pcmk__action_result_t *result, int exit_status, enum pcmk_exec_status exec_status, const char *exit_reason)
 
void pcmk__format_result (pcmk__action_result_t *result, int exit_status, enum pcmk_exec_status exec_status, const char *format,...)
 
void pcmk__set_result_output (pcmk__action_result_t *result, char *out, char *err)
 
void pcmk__reset_result (pcmk__action_result_t *result)
 
void pcmk__copy_result (const pcmk__action_result_t *src, pcmk__action_result_t *dst)
 

Variables

const size_t pcmk__n_rc = PCMK__NELEM(pcmk__rcs)
 

Function Documentation

◆ crm_abort()

void crm_abort ( const char *  file,
const char *  function,
int  line,
const char *  assert_condition,
gboolean  do_core,
gboolean  do_fork 
)

Definition at line 215 of file results.c.

◆ crm_exit()

crm_exit_t crm_exit ( crm_exit_t  exit_status)

Definition at line 1044 of file results.c.

◆ crm_exit_name()

const char* crm_exit_name ( crm_exit_t  exit_code)

Definition at line 696 of file results.c.

◆ crm_exit_str()

const char* crm_exit_str ( crm_exit_t  exit_code)

Definition at line 748 of file results.c.

◆ pcmk__abort_as()

_Noreturn void pcmk__abort_as ( const char *  file,
const char *  function,
int  line,
const char *  assert_condition 
)

Definition at line 150 of file results.c.

◆ pcmk__bzlib2rc()

int pcmk__bzlib2rc ( int  bz2)

Map a bz2 return code to the most similar Pacemaker return code.

Parameters
[in]bz2bz2 return code
Returns
Most similar Pacemaker return code

Definition at line 1014 of file results.c.

◆ pcmk__copy_result()

void pcmk__copy_result ( const pcmk__action_result_t src,
pcmk__action_result_t dst 
)

Definition at line 1187 of file results.c.

◆ pcmk__format_result()

void pcmk__format_result ( pcmk__action_result_t result,
int  exit_status,
enum pcmk_exec_status  exec_status,
const char *  format,
  ... 
)

Definition at line 1104 of file results.c.

◆ pcmk__gaierror2rc()

int pcmk__gaierror2rc ( int  gai)

Map a getaddrinfo() return code to the most similar Pacemaker return code.

Parameters
[in]gaigetaddrinfo() return code
Returns
Most similar Pacemaker return code

Definition at line 973 of file results.c.

◆ pcmk__reset_result()

void pcmk__reset_result ( pcmk__action_result_t result)

Definition at line 1163 of file results.c.

◆ pcmk__result_bounds()

int pcmk__result_bounds ( enum pcmk_result_type  type,
int *  lower,
int *  upper 
)

Definition at line 92 of file results.c.

◆ pcmk__set_result()

void pcmk__set_result ( pcmk__action_result_t result,
int  exit_status,
enum pcmk_exec_status  exec_status,
const char *  exit_reason 
)

Definition at line 1074 of file results.c.

◆ pcmk__set_result_output()

void pcmk__set_result_output ( pcmk__action_result_t result,
char *  out,
char *  err 
)

Definition at line 1143 of file results.c.

◆ pcmk_errorname()

const char* pcmk_errorname ( int  rc)
Deprecated:
Use standard return codes and pcmk_rc_name() instead

Definition at line 231 of file results.c.

◆ pcmk_legacy2rc()

int pcmk_legacy2rc ( int  legacy_rc)
Deprecated:
Use standard return codes instead

Definition at line 667 of file results.c.

◆ pcmk_rc2exitc()

crm_exit_t pcmk_rc2exitc ( int  rc)

Map a function return code to the most similar exit code.

Parameters
[in]rcFunction return code
Returns
Most similar exit code

Definition at line 810 of file results.c.

◆ pcmk_rc2legacy()

int pcmk_rc2legacy ( int  rc)
Deprecated:
Use standard return codes instead

Definition at line 654 of file results.c.

◆ pcmk_rc2ocf()

enum ocf_exitcode pcmk_rc2ocf ( int  rc)

Map a function return code to the most similar OCF exit code.

Parameters
[in]rcFunction return code
Returns
Most similar OCF exit code

Definition at line 938 of file results.c.

◆ pcmk_rc_name()

const char* pcmk_rc_name ( int  rc)

Get a return code constant name as a string.

Parameters
[in]rcInteger return code to convert
Returns
String of constant name corresponding to rc

Definition at line 449 of file results.c.

◆ pcmk_rc_str()

const char* pcmk_rc_str ( int  rc)

Get a user-friendly description of a return code.

Parameters
[in]rcInteger return code to convert
Returns
String description of rc

Definition at line 609 of file results.c.

◆ pcmk_result_get_strings()

int pcmk_result_get_strings ( int  code,
enum pcmk_result_type  type,
const char **  name,
const char **  desc 
)

Get the name and description of a given result code.

A result code can be interpreted as a member of any one of several families.

Parameters
[in]codeThe result code to look up
[in]typeHow code should be interpreted
[out]nameWhere to store the result code's name
[out]descWhere to store the result code's description
Returns
Standard Pacemaker return code

Definition at line 42 of file results.c.

◆ pcmk_strerror()

const char* pcmk_strerror ( int  rc)
Deprecated:
Use standard return codes and pcmk_rc_str() instead

Definition at line 257 of file results.c.

Variable Documentation

◆ pcmk__n_rc

const size_t pcmk__n_rc = PCMK__NELEM(pcmk__rcs)

Definition at line 439 of file results.c.