MCPcopy Create free account
hub / github.com/F-Stack/f-stack / fatal

Function fatal

freebsd/contrib/openzfs/cmd/ztest/ztest.c:590–618  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

588char *fatal_msg;
589
590static void
591fatal(int do_perror, char *message, ...)
592{
593 va_list args;
594 int save_errno = errno;
595 char *buf;
596
597 (void) fflush(stdout);
598 buf = umem_alloc(FATAL_MSG_SZ, UMEM_NOFAIL);
599
600 va_start(args, message);
601 (void) sprintf(buf, "ztest: ");
602 /* LINTED */
603 (void) vsprintf(buf + strlen(buf), message, args);
604 va_end(args);
605 if (do_perror) {
606 (void) snprintf(buf + strlen(buf), FATAL_MSG_SZ - strlen(buf),
607 ": %s", strerror(save_errno));
608 }
609 (void) fprintf(stderr, "%s\n", buf);
610 fatal_msg = buf; /* to ease debugging */
611
612 if (ztest_dump_core)
613 abort();
614 else
615 dump_debug_buffer();
616
617 exit(3);
618}
619
620static int
621str2shift(const char *buf)

Callers 15

ztest_randomFunction · 0.70
process_optionsFunction · 0.70
make_vdev_fileFunction · 0.70
ztest_spa_create_destroyFunction · 0.70
ztest_spa_checkpointFunction · 0.70
ztest_vdev_add_removeFunction · 0.70
ztest_vdev_class_addFunction · 0.70
ztest_vdev_attach_detachFunction · 0.70
ztest_vdev_LUN_growthFunction · 0.70
ztest_snapshot_createFunction · 0.70

Calls 6

umem_allocFunction · 0.85
sprintfFunction · 0.85
vsprintfFunction · 0.85
snprintfFunction · 0.85
abortClass · 0.85
dump_debug_bufferFunction · 0.70

Tested by

no test coverage detected