LOG_SYS_FATAL
LOG_SYS_FATAL
Description
Writes a fatal log message and aborts the program, with errno explanation appended at the end of final string.
Think of this as
perror() with LOG
Success
Message logged and program aborted via abort()
Failure
Logging may fail silently, but abort() will still execute
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Memory.c:131:
char *new_str = (char *)malloc(len + 1);
if (!new_str) {
LOG_SYS_FATAL("malloc() failed");
}- In
File.c:34:
if (!buffer) {
LOG_SYS_FATAL("malloc() failed");
}- In
Vec.c:90:
char *ptr = realloc(vec->data, (n + 1) * vec_aligned_size(vec, item_size));
if (!ptr) {
LOG_SYS_FATAL("realloc() failed");
}
// it's mandatory to set the pointer here, because next call to any vec_ will do a validation check
- In
Vec.c:135:
ptr = realloc(vec->data, (vec->length + 1) * vec_aligned_size(vec, item_size));
if (!ptr) {
LOG_SYS_FATAL("realloc() failed");
}
vec->capacity = vec->length;- In
Map.c:521:
map->states = old_states;
map->capacity = old_capacity;
LOG_SYS_FATAL("calloc() failed");
}- In
Proc.c:236:
int status;
if (-1 == waitpid(proc->pid, &status, 0)) {
LOG_SYS_FATAL("Failed to wait for child process");
}- In
Proc.c:251:
#else
if (WAIT_FAILED == WaitForSingleObject(proc->pi.hProcess, INFINITE)) {
LOG_SYS_FATAL("Failed to wait for child process");
}
Last updated on