20 #include <qb/qbdefs.h>
70 return "Generic Pacemaker error";
72 return "Operation requires quorum";
74 return "Update does not conform to the configured schema";
76 return "Schema transform failed";
78 return "Update was older than existing configuration";
80 return "Application of an update diff failed";
82 return "Application of an update diff failed, requesting a full refresh";
84 return "The on-disk configuration was manually modified";
86 return "Could not archive the previous configuration";
88 return "Could not save the new configuration to disk";
90 return "Could not parse on-disk configuration";
92 return "Resource active on multiple nodes";
94 return "Node not found";
96 return "Situation already as requested";
98 return "Bad name/value pair given";
100 return "Schema is already the latest available";
102 return "Unknown output format";
107 return "Name not unique on network";
110 return "Communication error on send";
113 return "Can not access a needed shared library";
116 return "Remote I/O error";
119 return "Protocol driver not attached";
122 return "Required key not available";
124 crm_err(
"Unknown error code: %d", rc);
125 return "Unknown error";
134 static struct pcmk__rc_info {
143 {
"pcmk_rc_unknown_format",
144 "Unknown output format",
147 {
"pcmk_rc_bad_nvpair",
148 "Bad name/value pair given",
152 "Already in requested state",
155 {
"pcmk_rc_node_unknown",
159 {
"pcmk_rc_multiple",
160 "Resource active on multiple nodes",
163 {
"pcmk_rc_cib_corrupt",
164 "Could not parse on-disk configuration",
167 {
"pcmk_rc_cib_save",
168 "Could not save new configuration to disk",
171 {
"pcmk_rc_cib_backup",
172 "Could not archive previous configuration",
175 {
"pcmk_rc_cib_modified",
176 "On-disk configuration was manually modified",
179 {
"pcmk_rc_diff_resync",
180 "Application of update diff failed, requesting full refresh",
183 {
"pcmk_rc_diff_failed",
184 "Application of update diff failed",
187 {
"pcmk_rc_old_data",
188 "Update was older than existing configuration",
191 {
"pcmk_rc_transform_failed",
192 "Schema transform failed",
195 {
"pcmk_rc_schema_unchanged",
196 "Schema is already the latest available",
199 {
"pcmk_rc_schema_validation",
200 "Update does not conform to the configured schema",
203 {
"pcmk_rc_no_quorum",
204 "Operation requires quorum",
207 {
"pcmk_rc_ipc_pid_only",
208 "IPC server process is active but not accepting connections",
211 {
"pcmk_rc_ipc_unresponsive",
212 "IPC server is unresponsive",
215 {
"pcmk_rc_ipc_unauthorized",
216 "IPC server is blocked by unauthorized process",
219 {
"pcmk_rc_op_unsatisifed",
220 "Not applicable under current conditions",
223 {
"pcmk_rc_undetermined",
224 "Result undetermined",
227 {
"pcmk_rc_before_range",
228 "Result occurs before given range",
231 {
"pcmk_rc_within_range",
232 "Result occurs within given range",
235 {
"pcmk_rc_after_range",
236 "Result occurs after given range",
239 {
"pcmk_rc_no_output",
240 "Output message produced no output",
243 {
"pcmk_rc_no_input",
244 "Input file not available",
249 #define PCMK__N_RC (sizeof(pcmk__rcs) / sizeof(struct pcmk__rc_info))
266 case E2BIG:
return "E2BIG";
267 case EACCES:
return "EACCES";
268 case EADDRINUSE:
return "EADDRINUSE";
269 case EADDRNOTAVAIL:
return "EADDRNOTAVAIL";
270 case EAFNOSUPPORT:
return "EAFNOSUPPORT";
271 case EAGAIN:
return "EAGAIN";
272 case EALREADY:
return "EALREADY";
273 case EBADF:
return "EBADF";
274 case EBADMSG:
return "EBADMSG";
275 case EBUSY:
return "EBUSY";
276 case ECANCELED:
return "ECANCELED";
277 case ECHILD:
return "ECHILD";
278 case ECOMM:
return "ECOMM";
279 case ECONNABORTED:
return "ECONNABORTED";
280 case ECONNREFUSED:
return "ECONNREFUSED";
281 case ECONNRESET:
return "ECONNRESET";
283 case EDESTADDRREQ:
return "EDESTADDRREQ";
284 case EDOM:
return "EDOM";
285 case EDQUOT:
return "EDQUOT";
286 case EEXIST:
return "EEXIST";
287 case EFAULT:
return "EFAULT";
288 case EFBIG:
return "EFBIG";
289 case EHOSTDOWN:
return "EHOSTDOWN";
290 case EHOSTUNREACH:
return "EHOSTUNREACH";
291 case EIDRM:
return "EIDRM";
292 case EILSEQ:
return "EILSEQ";
293 case EINPROGRESS:
return "EINPROGRESS";
294 case EINTR:
return "EINTR";
295 case EINVAL:
return "EINVAL";
296 case EIO:
return "EIO";
297 case EISCONN:
return "EISCONN";
298 case EISDIR:
return "EISDIR";
299 case ELIBACC:
return "ELIBACC";
300 case ELOOP:
return "ELOOP";
301 case EMFILE:
return "EMFILE";
302 case EMLINK:
return "EMLINK";
303 case EMSGSIZE:
return "EMSGSIZE";
304 #ifdef EMULTIHOP // Not available on OpenBSD
305 case EMULTIHOP:
return "EMULTIHOP";
307 case ENAMETOOLONG:
return "ENAMETOOLONG";
308 case ENETDOWN:
return "ENETDOWN";
309 case ENETRESET:
return "ENETRESET";
310 case ENETUNREACH:
return "ENETUNREACH";
311 case ENFILE:
return "ENFILE";
312 case ENOBUFS:
return "ENOBUFS";
313 case ENODATA:
return "ENODATA";
314 case ENODEV:
return "ENODEV";
315 case ENOENT:
return "ENOENT";
316 case ENOEXEC:
return "ENOEXEC";
317 case ENOKEY:
return "ENOKEY";
318 case ENOLCK:
return "ENOLCK";
319 #ifdef ENOLINK // Not available on OpenBSD
320 case ENOLINK:
return "ENOLINK";
322 case ENOMEM:
return "ENOMEM";
323 case ENOMSG:
return "ENOMSG";
324 case ENOPROTOOPT:
return "ENOPROTOOPT";
325 case ENOSPC:
return "ENOSPC";
326 case ENOSR:
return "ENOSR";
327 case ENOSTR:
return "ENOSTR";
328 case ENOSYS:
return "ENOSYS";
329 case ENOTBLK:
return "ENOTBLK";
330 case ENOTCONN:
return "ENOTCONN";
331 case ENOTDIR:
return "ENOTDIR";
332 case ENOTEMPTY:
return "ENOTEMPTY";
333 case ENOTSOCK:
return "ENOTSOCK";
334 #if ENOTSUP != EOPNOTSUPP
335 case ENOTSUP:
return "ENOTSUP";
337 case ENOTTY:
return "ENOTTY";
339 case ENXIO:
return "ENXIO";
340 case EOPNOTSUPP:
return "EOPNOTSUPP";
341 case EOVERFLOW:
return "EOVERFLOW";
342 case EPERM:
return "EPERM";
343 case EPFNOSUPPORT:
return "EPFNOSUPPORT";
344 case EPIPE:
return "EPIPE";
345 case EPROTO:
return "EPROTO";
346 case EPROTONOSUPPORT:
return "EPROTONOSUPPORT";
347 case EPROTOTYPE:
return "EPROTOTYPE";
348 case ERANGE:
return "ERANGE";
349 case EREMOTE:
return "EREMOTE";
351 case EROFS:
return "EROFS";
352 case ESHUTDOWN:
return "ESHUTDOWN";
353 case ESPIPE:
return "ESPIPE";
354 case ESOCKTNOSUPPORT:
return "ESOCKTNOSUPPORT";
355 case ESRCH:
return "ESRCH";
356 case ESTALE:
return "ESTALE";
357 case ETIME:
return "ETIME";
358 case ETIMEDOUT:
return "ETIMEDOUT";
359 case ETXTBSY:
return "ETXTBSY";
360 case EUNATCH:
return "EUNATCH";
361 case EUSERS:
return "EUSERS";
363 case EXDEV:
return "EXDEV";
365 #ifdef EBADE // Not available on OS X
366 case EBADE:
return "EBADE";
367 case EBADFD:
return "EBADFD";
368 case EBADSLT:
return "EBADSLT";
369 case EDEADLOCK:
return "EDEADLOCK";
370 case EBADR:
return "EBADR";
371 case EBADRQC:
return "EBADRQC";
372 case ECHRNG:
return "ECHRNG";
373 #ifdef EISNAM // Not available on OS X, Illumos, Solaris
374 case EISNAM:
return "EISNAM";
375 case EKEYEXPIRED:
return "EKEYEXPIRED";
377 case EKEYREVOKED:
return "EKEYREVOKED";
379 case EL2HLT:
return "EL2HLT";
380 case EL2NSYNC:
return "EL2NSYNC";
381 case EL3HLT:
return "EL3HLT";
382 case EL3RST:
return "EL3RST";
383 case ELIBBAD:
return "ELIBBAD";
384 case ELIBMAX:
return "ELIBMAX";
385 case ELIBSCN:
return "ELIBSCN";
386 case ELIBEXEC:
return "ELIBEXEC";
387 #ifdef ENOMEDIUM // Not available on OS X, Illumos, Solaris
388 case ENOMEDIUM:
return "ENOMEDIUM";
389 case EMEDIUMTYPE:
return "EMEDIUMTYPE";
391 case ENONET:
return "ENONET";
392 case ENOPKG:
return "ENOPKG";
393 case EREMCHG:
return "EREMCHG";
394 case ERESTART:
return "ERESTART";
395 case ESTRPIPE:
return "ESTRPIPE";
396 #ifdef EUCLEAN // Not available on OS X, Illumos, Solaris
397 case EUCLEAN:
return "EUCLEAN";
399 case EXFULL:
return "EXFULL";
401 default:
return "Unknown";
422 return "Unknown error";
445 legacy_rc = abs(legacy_rc);
465 default:
return legacy_rc;
515 return "CRM_EX_UNKNOWN";
537 case CRM_EX_OSERR:
return "Operating system error occurred";
545 case CRM_EX_FATAL:
return "Fatal error occurred, will not respawn";
558 case CRM_EX_OLD:
return "Update was older than existing configuration";
562 if ((exit_code > 128) && (exit_code <
CRM_EX_MAX)) {
563 return "Interrupted by signal";
565 return "Unknown exit status";
647 case EPROTONOSUPPORT:
670 #if EOPNOTSUPP != ENOTSUP
728 case BZ_CONFIG_ERROR:
729 return "libbz2 has been improperly compiled on your platform";
730 case BZ_SEQUENCE_ERROR:
731 return "library functions called in the wrong order";
733 return "parameter is out of range or otherwise incorrect";
735 return "memory allocation failed";
737 return "data integrity error is detected during decompression";
738 case BZ_DATA_ERROR_MAGIC:
739 return "the compressed stream does not start with the correct magic bytes";
741 return "error reading or writing in the compressed file";
742 case BZ_UNEXPECTED_EOF:
743 return "compressed file finishes before the logical end of stream is detected";
744 case BZ_OUTBUFF_FULL:
745 return "output data will not fit into the buffer provided";
747 return "Unknown error";
756 if ((((
int) rc) < 0) || (((
int) rc) >
CRM_EX_MAX)) {
#define pcmk_err_old_data
#define pcmk_err_schema_validation
const char * pcmk_errorname(int rc)
crm_exit_t crm_errno2exit(int rc)
const char * pcmk_strerror(int rc)
const char * bz2_strerror(int rc)
#define pcmk_err_no_quorum
#define pcmk_err_schema_unchanged
int pcmk_rc2legacy(int rc)
_Noreturn crm_exit_t crm_exit(crm_exit_t rc)
void crm_xml_cleanup(void)
#define pcmk_err_transform_failed
crm_exit_t pcmk_rc2exitc(int rc)
Map a function return code to the most similar exit code.
#define pcmk_err_node_unknown
void mainloop_cleanup(void)
enum crm_exit_e crm_exit_t
const char * pcmk_rc_str(int rc)
Get a user-friendly description of a return code.
char * strerror(int errnum)
#define pcmk_err_cib_backup
Wrappers for and extensions to glib mainloop.
#define pcmk_err_cib_save
#define pcmk_err_diff_failed
const char * crm_exit_str(crm_exit_t exit_code)
#define PCMK_ERROR_OFFSET
#define pcmk_err_multiple
#define crm_trace(fmt, args...)
Wrappers for and extensions to libxml2.
int pcmk_legacy2rc(int legacy_rc)
#define pcmk_err_cib_modified
#define pcmk_err_diff_resync
void pcmk__cli_option_cleanup(void)
const char * pcmk_rc_name(int rc)
Get a return code constant name as a string.
#define crm_err(fmt, args...)
#define pcmk_err_unknown_format
#define pcmk_err_bad_nvpair
#define pcmk_err_cib_corrupt
#define crm_info(fmt, args...)
const char * crm_exit_name(crm_exit_t exit_code)