mirror of
https://github.com/labwc/labwc.git
synced 2025-11-04 13:30:07 -05:00
log: add die() for convenience
This commit is contained in:
parent
c8040e4d3b
commit
aab7b71520
2 changed files with 17 additions and 0 deletions
|
|
@ -32,3 +32,15 @@ warn(const char *err, ...)
|
|||
fprintf(stderr, LABWC_COLOR_RESET);
|
||||
fprintf(stderr, "\n");
|
||||
}
|
||||
|
||||
void
|
||||
die(const char *err, ...)
|
||||
{
|
||||
va_list params;
|
||||
fprintf(stderr, "[labwc] fatal: ");
|
||||
va_start(params, err);
|
||||
vfprintf(stderr, err, params);
|
||||
va_end(params);
|
||||
fprintf(stderr, "\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue