mirror of
https://github.com/swaywm/sway.git
synced 2026-03-29 07:58:16 -04:00
save errno to avoid issues with it being overwritten
This commit is contained in:
parent
45f14fcb24
commit
97ad9ab984
1 changed files with 2 additions and 1 deletions
|
|
@ -127,6 +127,7 @@ void _sway_abort(const char *filename, int line, const char* format, ...) {
|
|||
}
|
||||
|
||||
void sway_log_errno(log_importance_t verbosity, char* format, ...) {
|
||||
int errsv = errno;
|
||||
if (verbosity <= v) {
|
||||
unsigned int c = verbosity;
|
||||
if (c > sizeof(verbosity_colors) / sizeof(char *) - 1) {
|
||||
|
|
@ -145,7 +146,7 @@ void sway_log_errno(log_importance_t verbosity, char* format, ...) {
|
|||
va_end(args);
|
||||
|
||||
fprintf(stderr, ": ");
|
||||
fprintf(stderr, "%s", strerror(errno));
|
||||
fprintf(stderr, "%s", strerror(errsv));
|
||||
|
||||
if (colored && isatty(STDERR_FILENO)) {
|
||||
fprintf(stderr, "\x1B[0m");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue