Commit c6577473 authored by Arkadiusz Hiler's avatar Arkadiusz Hiler

lib/igt_core: Move write_stderr out of LIBUNWIND ifdef

write_stderr() and __write_stderr() are defined behind ifdef on
HAVE_LIBUNWIND, but do no depend on the lib in any way.

fatal_sig_handler() uses those helpers unconditionally.

This patch just moves the code couple of lines up, so the helpers are
always available and do not break build on systems without libunwind.

Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Signed-off-by: default avatarArkadiusz Hiler <arkadiusz.hiler@intel.com>
Reviewed-by: Tvrtko Ursulin's avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
parent 2a1c1c09
......@@ -1231,6 +1231,16 @@ static bool run_under_gdb(void)
strncmp(basename(buf), "gdb", 3) == 0);
}
static void __write_stderr(const char *str, size_t len)
{
igt_ignore_warn(write(STDERR_FILENO, str, len));
}
static void write_stderr(const char *str)
{
__write_stderr(str, strlen(str));
}
#ifdef HAVE_LIBUNWIND
#define UNW_LOCAL_ONLY
#include <libunwind.h>
......@@ -1407,16 +1417,6 @@ xprintf(const char *fmt, ...)
va_end(ap);
}
static void __write_stderr(const char *str, size_t len)
{
igt_ignore_warn(write(STDERR_FILENO, str, len));
}
static void write_stderr(const char *str)
{
__write_stderr(str, strlen(str));
}
static void print_backtrace_sig_safe(void)
{
unw_cursor_t cursor;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment